+ All Categories
Home > Documents > Linear Programming

Linear Programming

Date post: 13-Sep-2014
Category:
Upload: laestat
View: 647 times
Download: 14 times
Share this document with a friend
Popular Tags:
37
chap-5a B.V.Ramana September 13, 2006 17:59 Chapter 5 Linear Programming 5.1 INTRODUCTION Optimization problems seek to maximize or min- imize 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 lim- ited resources to achieve a given object forms pro- gramming problems. A programming problem in which all the relations between the variables is lin- ear 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, con- tinues 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, transporta- tion 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 maximiz- ing or minimizing a linear function of these vari- ables, known as objective function, subject to certain linear inequality or equality constraints. These vari- ables, should also satisfy the nonnegativity restric- tions since these physical quantities can not be neg- ative. Here linearity is characterized by proportion- ality and additivity properties. Let x 1 ,x 2 ...,x n be the n decision unknown vari- ables and c 1 ,c 2 ...,c n be the associated (constant cost) coefficients. Then the aim of LP is to optimize (extremise) the linear function, z = c 1 x 1 + c 2 x 2 + ... + c n x n (1) Here (1) is known as the objective function. (O.F.) The variables x j are subject to the following m linear constraints a i 1 x 1 + a i 2 x 2 + ... + a in x n b i (2) for i = 1, 2, ... m. In (2), for each constraint only one of the signs or or = holds. Finally x i should also satisfy nonnegativity restrictions x j 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
Transcript
Page 1: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

Chapter5Linear Programming

5.1 INTRODUCTION

Optimization problems seek to maximize or min-imize a function of a number of variables whichare subject to certain constraints. The objective maybe to maximize the profit or to minimize the cost.The variables may be products, man-hours, moneyor even machine hours. Optimal allocation of lim-ited resources to achieve a given object forms pro-gramming problems. A programming problem inwhich all the relations between the variables is lin-ear including the function to be optimized is called aLinear Programming Problem (LPP). G.B. Dantzig,in 1947, first developed and applied general problemof linear programming. Classical examples includetransportation problem, activity-analysis problem,diet problems and network problem. The simplexmethod, developed by GB Dantzig, in 1947, con-tinues to be the most efficient and popular method tosolve general LPP. Karmarkar’s method developedin 1984 has been found to be upto 50 times as fast asthe simplex algorithm. LPP is credited to the worksof Kuhn, Tucker, Koopmans, Kantorovich, CharnesCooper, Hitchcock, Stiegler. LPP has been used tosolve problems in banking, education, distributionof goods, approximation theory, forestry, transporta-tion and petroleum.

5.2 FORMULATION OF LPP

In a linear programming problem (LPP) we wish todetermine a set of variables known as decision vari-

ables. This is done with the objective of maximiz-ing or minimizing a linear function of these vari-ables, known as objective function, subject to certainlinear inequality or equality constraints. These vari-ables, should also satisfy the nonnegativity restric-tions since these physical quantities can not be neg-ative. Here linearity is characterized by proportion-ality and additivity properties.

Let x1, x2 . . . , xn be the n decision unknown vari-ables and c1, c2 . . . , cn be the associated (constantcost) coefficients. Then the aim of LP is to optimize(extremise) the linear function,

z = c1x1 + c2x2 + . . . + cnxn (1)

Here (1) is known as the objective function. (O.F.)The variables xj are subject to the following m linearconstraints

ai1x1 + ai2x2 + . . . + ainxn

⎧⎨⎩

≥≤≥

⎫⎬⎭ bi (2)

for i = 1, 2, ... m. In (2), for each constraint only oneof the signs ≥ or ≤ or = holds. Finally xi should alsosatisfy nonnegativity restrictions

xj ≥ 0 for j = 1 to n (3)

Thus a general linear programming problem consistsof an objective function (1) to be extremized subjectto the constraints (2) satisfying the non-negativityrestrictions (3).

5.1

Page 2: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.2 MATHEMATICAL METHODS

Solution

To LPP is any set of values {x1, x2 . . . , xn} whichsatisfies all the m constraints (2).

Feasible Solution

To LPP is any solution which would satisfy the nonnegativity 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 solu-tions to an LPP, we should find the optimal feasiblesolution in which the maximum (or minimum) valueof z is finite.

Example 1: Suppose Ajanta clock company pro-duces two types of clocks “standard” and “deluxe”using three different inputs A, B, C. From the datagivenbelow formulate theLPP to determine the num-ber of standard and deluxe clock to be manufacturedto maximize the profit.

Let x1 and x2 be the number of “standard” and“deluxe” clocks to be produced.

Technical coefficients

InputStandard Deluxe

Capacity(Resource)

ABC

2242

4203

201216C

Profit (Rs)

Then the objective function is to maximize thetotal profit i.e. maximize z = 2x1 + 3x2, since theprofit for one standard clock is Rs 2 and profit forone deluxe and clock is Rs 3. Because of the limitedresources, for input A we have the following restric-tion. Since one standard clock consumes 2 units ofresource A, x1 units of standard clocks consume 2x1

units of input A. Similarly 4x2 units of input A isrequired to produce x2 deluxe clocks. Thus the totalrequirement of the input A for production of x1, stan-dard and x2 deluxe clocks is

2x1 + 4x2.

However, the total amount of resource A available is20 units only. Therefore the restriction on resourceA 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 ofclocks produced), they must be non negative i.e.

x1 ≥ 0

and x2 ≥ 0.

Thus the LPP consists of the O.F., three inequalityconstraints 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 probleminvolving any number of constraints can be obtainedgraphically. Consider the first quadrant of the x1x2

plane since the two variables x1 and x2 should sat-isfy the nonnegativity restrictions x1 ≥ 0 and x2 ≥ 0.Now the basic feasible solution space is obtained inthe first quadrant by plotting all the given constraintsas follows. For a given inequality, the equation withequality sign (replacing the inequality) represents astraight line in x1x2 plane dividing it into two openhalf spaces. By a test reference point, the correct sideof the inequality is identified. Say choosing origin(0, 0) as a reference point, if the inequality is satis-fied then the correct side of the inequality is the sideon which the origin (0, 0) lies. Indicate this by anarrow. When all the inequalities are plotted like this,in general, we get a bounded (or unbounded in caseof greater than inequalities) polygon which enclosethe feasible solution space, any point of which is afeasible solution.

For z = z0, the objective function z = c1x1 + c2x2

represents an iso-contribution (or iso-profit) straight

line say x2 = − c1c2

x1 + z0c2

(or x1 = −c2

c1x2 + z

c1

)

Page 3: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.3

such that for any point on this line, the contribu-tion (Profit) (value of z0) is same. To determine theoptimal solution, in the maximization case, assign-ing arbitrary values to z, move the iso-contributionline in the increasing direction of z without leav-ing the feasible region. The optimum solution occursat a corner (extreme) point of the feasible region.So the iso-profit line attains its maximum value ofz and passes through this corner point. If the iso-contribution line (objective function) coincides withone of the edges of the polygon, then any point onthis edge gives optimal solution with the same max-imum (unique) value of the objective function. Sucha case is known asmultiple (alternative) optima case.In the minimization case, assigning arbitrary valuesto z, move the iso-contribution line in the directionof decreasing z until it passes through a corner point(or coincides with an edge of the polygon) in whichcase the minimum is attained at this corner point.

Range of Optimality

For a givenobjective function z = c1x1 + c2x2, slopeof z changes as the coefficients c1 and c2 changewhich may result in the change of the optimal cornerpoint itself. In order to keep (maintain) the currentoptimum solution valid, we can determine the range

of optimality for the ratio c1c2

(or c2

c1

)by restricting the

variations for both c1 and c2.

Special Cases:

(a) The feasible region is unbounded and in the caseof maximization, has an unbounded solution orbounded solution.

(b) Feasible region reduces to a single point whichitself is the optimal solution. Such a trivial solu-tion is of no interest since this can be neither max-imized nor minimized.

(c) A feasible region satisfying all the constraints isnot possible since the constraints are inconsistent.

(d) LPP is ill-posed if the non-negativity restrictionare not satisfied although all the remaining con-straints are satisfied.

Examples:

(a) x1+3x2 ≥ 3, x1+x2 ≥ 2, x1, x2 ≥ 0,Maximize: z = 1.5x1 + 2.5x2 unbounded feasi-ble region, unbounded solution (can be maxi-mized indefinitely)

Fig. 5.1

(b) x1−x2 ≥0, −0.5x1+x2 ≤1 x1, x2 ≥0Maximize: z = x2 − 0.75x1 unbounded feasibleregion z2 = 0.5 is bounded optimal solution.

Fig. 5.2

(c) x1 + x2 ≤ 2, −x1, −5x2 ≤ −10Maximize: z = −5x2, x1, x2 ≥ 0, (0, 2) is uniquesolution, max: z = −10.

(0, 2)

Fig. 5.3

(d) x1 + x2 ≤ 1, −0.5x1 − 5x2 ≤ −10Maximize: z = −5x2, x1, x2 ≥ 0. No feasibleregion. Constraints are inconsistent

Page 4: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.4 MATHEMATICAL METHODS

Fig. 5.4

(e) 1.5x1 + 1.5x2 ≥ 9, x1 + x2 ≤ 2.No feasible region.

(0, 6)

(6, 0)

(0, 2)

(2, 0)

WORKED OUT EXAMPLES

Example 1: ABC company produces two types ofcalculators. A business calculator requires 1 hour ofwiring, one hour of testing and 3 hours of assem-bly, while a scientific calculator requires 4 hours ofwiring, one hour of testing and one hour of assembly.A total of 24 hours of wiring, 21 hours of assemblyand 9 hours of testing are availablewith the company.If the company makes a profit of Rs 4 on businesscalculator (BC) and Rs 10 on scientific calculator(SC), determine the best product mix to maximizethe profit.

Solution: Let x1 be the number of business cal-culators (BC) produced while x2 be the number ofscientific calculators (SC) produced. Then the objec-tive is to maximize the profit z = 4x1 + 10x2 subjectto the following fine constraints:

x1 + 4x2 ≤ 24 (wiring) (I)

x1 + x2 ≤ 9 (testing) (II)

3x1 + x2 ≤ 21 (assembly) (III)

x1 ≥ 0x2 ≥ 0

{non negative (IV)constraints (V)

To determine the feasible solution space considerthe first quadrant of the x1x2-plane since x1 ≥ 0and x2 ≥ 0. Then draw the straight lines x1 + 4x2 =

24, x1 + x2 = 9 and 3x1 + x2 = 2.1. Note that aninequality divides the x1x2-plane into two open half-space. Choose any reference point in the first quad-rant. If this reference point satisfies the inequalitythen the correct side of the inequality is the side onwhich the reference point lies. Generally origin (0,0) is taken as the reference point. The correct side ofthe inequality is indicated by an arrow. The shadedregion is the required feasible solution space satisfy-ing all the five constraints. The five corner points ofthe feasible region are A(0, 0), B(7, 0), C(6, 3), D(4,5), E(0, 6). Identify the direction inwhich z increaseswithout leaving the region. Arbitrarily choosing z =0, 28, 54, 60, 66, observe that the straight lines (profitfunction) z = 4x1 + 10x2 or x2 = − 2

5x1 + z10 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 businessand 5 scientific calculator which gives a maximumprofit of Rs. 66.

x2

SolutionSpace

3+

=21

xx

12

xx1

2+ 4 = 24

x

x

1

2+

=9

3

1

2

Range ofoptimality

Incre

asin

gz

z = 0

z = 28

z = 54E

z = 60

z = 66

A B

C

D

x1

Optim

um

Fig. 5.5

Example 2: (a) Solve the above problems to min-imize z = −4x1 − 10x2.(b) If z = c1x1 + c2x2, does an alternative optimalsolution exists(c) Determine the range of optimality for the ratioc1c2

(or c2

c1

).

Page 5: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.5

Solution: (a) Rewriting, x2 = − 25x1 − z

10 . Choosez = 0, −28, −54, −60, −66, then the objectivefunction passes through the corner points A, B, C,E, D respectively. Thus the minimum value z = −66is attained at the corner point D(4, 5). Observe thatmaximum of z = 4x1 + 10x2 is 66 and minimum ofz = −4x1 − 10x2 is − 66i.e., max f (x) = −min (−f (x)).(b) If z = c1x1 + c2x2 coincideswith the straight lineCD: x1 + x2 = 9, then any point on the line segmentCD is an optimal solution to the current problem andthus has multiple (infinite) alternative optima.(c) Let z = c1x1 + c2x2 be the objective function.Then for c2 �= 0, we write this as

x2 = −c1

c2x1 + z

c2

The straight linex1 + 4x2 = 24 rewritten as x2 = − 1

4x1 + 244 has

slope − 14 and the straight line x1 + x2 = 9 rewritten

as x2 = −x1 + 9 has slope −1. Thus range of opti-mality which will keep the present optimum solutionvalid is

1

4≤ c1

c2≤ 1

For c2 = 4, 1 ≤ c1 ≤ 4Similarly for c1 �= 0, the range of optimality is1 ≤ c2

c1≤ 4. For c1 = 2, 2 ≤ c2 ≤ 8.

Example 3: Theminimum fertilizer needed/hectoris 120 kgs nitrogen, 100 kgs phosphorous and 80 kgsof potassium.Twobrands of fertilizers available havethe following composition.

Fertilizer Nitrogen Phos. Potassium Price/100 kgs bagA 20% 10% 10% Rs 50B 10% 20% 10% Rs 40

Determine the number of bags of fertilizer A andB which will meet the minimum requirements suchthat the total cost is minimum.

Solution: Let X be the number of bags of fertilizerA purchased andY be the number of bags of fertilizerB purchased. Then the objective is to minimize thetotal cos t = z = 50X + 40Ysubject to

20X + 10Y ≥ 120 (Nitrogen)10X + 20Y ≥ 100 (Phosphorous)

10S + 10Y ≥ 80 (Potassium)and X, Y ≥ 0Draw the straight lines

2X + Y = 12 (1)

X + 2Y = 10 (2)

X + Y = 8 (3)

A(0, 12), B(4, 4), C(6, 2), D(10, 0)

X2

2

3

3

1

1

z = 500z = 480

z = 380z =

360

C

B

A

Y

Decreasingdirection

of z

(Unbounded)Feasibleregion

D

Fig. 5.6Objective function: iso-profit equation:

Y = −5

4X + z

40(4)

Choose z = 500, 480, 380, 360 then (4) passesthrough the corner points D, A, C, B respectively.Thus the optimal solution occurs at B(4, 4) i.e. pur-chase four bags of fertilizer A and 4 bags of fertilizerB with a total minimum cost of Rs 360/-.

EXERCISE

Solve the following LPP graphically:

1. Right Wood Furniture Company manufactureschairs and desks. The time required (in minutes)and the total available time is given below. If com-pany sells a chair for a profit of Rs. 25 and desk

Page 6: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.6 MATHEMATICAL METHODS

for a profit of Rs 75/- determine the best productmix that will maximize the profit.

Chair DeskAvailable

time

Fabrication

Assembly

Upholstery

Linoleum

15

12

18.75

40

50

56.25

27,000

27,000

27,000

27,000

Ans: Produce 1000 chairs and 300 desks, making aprofit of Rs 47,500.

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 thefollowing requirements.

StandardPaint

DeluxPaint

Total AvailableQuantity (in tons)

Base

Chemicals

Profit (in 100’s)

6

1

5

4

2

4

24

6

Determine the optimum (best) product mix of thepaints that maximizes the total profit for the com-pany. Demand for deluxe paint can not exceedthat of standard paint by more than 1 ton. Alsomaximum demand of deluxe paint is 2 tons.

Ans: Produce 3 tons of standard and 1.5 tons of deluxepaint, making a profit of Rs 2100.

Hint: Corner points: A(0, 0), B(4, 0), C(3, 1.5),D(2, 2), E(1, 2), F(0, 1);OF:Maximize z = 5x1 +4x2 subject to

6x1 + 4x2 ≤ 24, x1 + 2x2 ≤ 6,

−x1 + x2 ≤ 1, x2 ≤ 2, x1, x2 ≥ 0.

3. In an oil refinery, two possible blending processesfor which the inputs and outputs per productionrun are given below.

Process

I

II

Input

Crude Crude

5 3

4 5

A B

Output

Gasoline Gasoline

5 8

4 4

X Y

A maximum of 200 units of crude A and 150units of crude B are available. It is required toproduce at least 100 units of gasoline X and 80units of gasolineY . The profit fromprocess I is Rs300 while from process II is Rs 400. Determinethe optimal mix of the two processes.

Ans: Produce 30.7 units by process I and 11.5 unitsfrom process II, getting a maximum profit of Rs13,846.20.

Hint: Maximize: z = 300x1 + 400x2, subject to5x1 + 4x2 ≤ 200, 3x1 + 5x2 ≤ 1505x1 + 4x2 ≥ 100, 8x1 + 4x2 ≥ 80Corner points: A(20, 0), B(40, 0), D(0, 30),

E(0, 25), C(40013 , 150

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: Rs437.64.

5. Maximize: z = 30x1 + 20x2 subject to x1 ≤ 60,x2 ≤ 75, 10x1 + 8x2 ≤ 800.

Ans: x1 = 60, x2 = 25, Max: profit = Rs 2300

Hint:Corner points: A(0, 0), B(60, 0), C(60, 25),D(20, 75), E(0, 75).

6. Given x1 ≥ 0, x2 ≥ 0, x1 + 2x2 ≤ 8, 2x1 − x2 ≥−2 solve to (a) max x1 (b) max x2 (c) min x1 (d)min x2 (e) max 3x1 + 2x2 (f) min −3x1 − 2x2 (g)max 2x1 − 2x2

Ans: (a) x1 = 8 (b) x2 = 185 (c) x1 = 0 (d) x2 = 0 (e) z

= 24, x1 = 8, x2 = 0 (f) z = −24, x1 = 8, x2 = 0(g) z = − 28

5 , x1 = 45 , x1 = 18

5

7. Minimize z = x1 + x2 s.t. x1 ≥ 0,x2 ≥ 0 2x1 = x2 ≥ 12, 5x1 + 8x2 ≥ 74,x1 + 6x2 ≥ 28.

Ans: x1 = 2, x3 = 8, min. 10

Hint: Unbounded region with corner pointsA(0, 12), B(2, 8), C(10, 3), D(28, 0)

Page 7: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.7

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 ≥403 .

Ans: x1 = 12, x2 = 4, zmin = 88,000

Hint: A(22, 0), B(12, 4), C(0, 40)Note: Constraint x1 + x2 ≥ 40

3 is redundant.

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 FORMSOF LPP

Since max f (x) = −min (−f (x)), an LPP withmaximation can be transferred to a minimizationproblem and vice versa. Thus, the following analysiscan be applied for a maximization or minimizationproblem 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 orequal to type.Standard form of LPP consists of (1) (2) (3) with allconstraints (2) are of the equality type and with allbi ≥ 0, for i = 1 to m.Conversion to Standard Form Given any generalLPP, it can be transformed to standard LPP as fol-lows:

1. In any constraint if the right hand side con-stant bi is negative, then multiply that constraint

throughout by −1. (Note that multiplication of aninequality constraint by−1, reverses, the inequal-ity sign i.e. −3 < −2, multiplied by −1 we get(−1)(−3) > (−1)(−2)or3 > 2.

2. A less than or equal to type constraint∑j

aij xj ≤ bi ; (bi ≥ 0) gets transformed to an

equality∑j

aij xj + si = bi

by the addition of a ’slack’ variable si , whichis non negative.

3. A greater than or equal to type constraint∑j

aij xj ≥ bi ; (bi ≥ 0)

can be transformed to an equality∑aij xj − si = bi

by subtracting a ’surplus’ variable Si , whichis non negative. In general, it is more convenientto work with equations rather than with inequal-ities. So given any general LPP, convert it to astandard LPP, consisting of ’m’ simultaneous lin-ear equations in "n" unknown decision variables.

Minimize:z = c1x1 + c2x2 + · · · + cnxn (1)subject to

a11x1 + a12x2 + · · · + a1nxn = b1

a21x1 + a22x2 + · · · + a2nxn = b2

− − − − − − − − − − − − − − −am1x1 + am2x2 + · · · + amnxn = bm

⎫⎪⎪⎬⎪⎪⎭

(2)

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 equa-tions. If m = n, the problem may have a unique(single) solution which is of no interest sinceit can neither be maximized or minimized. Ifm < n, which ensures that none of the equationsis redundant, then there may exist infinite numberof solutions from which an optimal solution canbe obtained.

Assume that m < n. Set arbitrarily anyn − m variables equal to zero and solve the mequations for the remaining m unknowns. Sup-pose the unique solution obtained be

{x1, x2, · · · xm}, by setting the remaining(n − m) variables

xm+1, · · · , xn all to zero.

Page 8: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.8 MATHEMATICAL METHODS

Basic solution

{x1, x2, · · · , xm} is the solution of the systemof equa-tions (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 whichare equated to zero to solve the m equations (2),(resulting in the basic solution).

Basic feasible solution

is a basic solution which satisfies the nonnegativityrestrictions, (3) i.e. all basic variables are non nega-tive. (i.e. xj ≥ 0 for j = 1, 2, 3, · · · m)

Nondegenerate basic feasible solution

is a basic feasible solution in which all the basic vari-ables are positive (i.e., xj > 0 for j = 1, 2, 3, · · · m)

Optimal basic feasible solution

is a basic feasible solution which optimizes (in thiscase minimizes) the objective function (1).

Why Simplex Method

In an LPP with m equality constraints and n vari-ables with m < n, the number of basic solutions isncm. For small n and m, all the basic solutions (cor-ner points) can be enumerated (listed out) and theoptimal 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, ncm = 4c2 = 6 The sixbasic solutions are: 1. (0, 0, 4, 5), Feasible (F), Non-degenerate (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, ND5. (5, 0, - 6, 0), NF6. (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, alarge part of which are infeasible. It is proved thatthe set of feasible solutions to a LPP form a convexset (the line joining any two points of the set lies inthe set) and the corner (extreme) points of the convexset are basic feasible solutions. If there is an optimalsolution, it exists at one of these corner points. Thesimplex method devised by GB Dantzig is a power-ful procedure which investigates in a systematic wayfor optimal solution at these corner points which arefinite in number.

For m = 10, n = 20, simplex method obtains theoptimal in 15 steps, thus having an advantage of92,378 to 1.

5.5 SIMPLEX METHOD

The simplex method is an algebraic iterative pro-cedure which solves any LPP exactly (not approxi-mately) or gives an indication of an unbounded solu-tion. Starting at an initial extreme point, it movesin a finite number of steps, between m and 2m, fromone extreme point to the optimal extreme point. Con-sider the following LPP with ’m’ less than or equalto inequalities in ’n’ variables.

Maximize z = c1x1 + c2x2 + · · · + cnxn

subject to a11x1 + a12x2 + · · · + a1nxn ≤ b1

a21x1 + a22x2 + · · · + a2nxm ≤ b2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

am1xm1 + am2x2 + · · · + amnxn ≤ bm

Introducing ’m’ slack variables s1, s2, . . ., sm, theless than or equal to in equalities are converted toequations.

a11x1 + a12x2 + · · · + a1nxn + s1 = b1

a21x1 + a22x2 + · · · + a2nxn + s2 = b2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

am1x1 + am2x2 + · · · + amnxn + · · · + sm = bm

Here x1, x2, · · · , xn, s1, s2, · · · , sm are all nonneg-ative i.e. ≥ 0. The objective function is rewritten as

Page 9: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.9

Maximize: z = c1x1 + · · · + cnxn + 0.s1 + · · · +0.sm.

Thus there are m equations in m + n variables.Putting (m + n) − m = n variables zero we get astarting basic feasible solution. Take x1 = x2 =· · · xn = 0. Then the initial solution contains the m

basic variables s1, s2 · · · , sm. This corresponds to thecorner point origin with value of the objective func-tion zero. Since this is a problem of maximization,the value of objective function will increase if weintroduce 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 . Tiesare broken arbitrarily. The objective equation is writ-ten as z − c1x1 − c2x2 − · · · − cnxn + 0.s1 + · · · +0.sn = 0

For efficient use, this data is written in the form ofa table known as simplex tableau shown below:

Remark Basis Solution

-row 1 – – – – 0 0 0 0

-row 0 1 0 0

s -row 0 0 1

-row

-row 0 0 0 1

z x x x xn s s s

c z c c c c

s s a a a a b

s a a a a b

s a

s s a a a a b

1 2 1 2

1 2

1 1 11 12 1 1 1

2 2 21 22 2 2 2

1 2

j m

j n

j n

j n

i ij

m m m m mj mn m

1

��

��

��

��

��

��

� � � �

��

��

��

�The first row, z-row contains the coefficients of

the objective equation with last element in rectangleindicating the current value of the objective func-tion (In the present case it is zero). The left most(first) column indicates the current basic variabless1, s2, · · · , sm. The right most (last) column is thesolution column. Thus s1 = b1, s2 = b2, · · · , sm =bm (all resources unused) is the basic solution withthe value of the objective function zero.

Test for optimality

If all the z-row coefficients of the nonbasic variablesare nonnegative, then the current solution is optimal.Stop. Otherwise goto step I.Step I. Entering variables: Suppose - cj , the z-rowcoefficient of the non basic variables xj is the mostnegative, then the variable xj will enter the basis. Thej th column is known as the pivotal column.Step II. Leaving variable: Divide the solution col-umn with the corresponding elements of the pivotalcolumn, with strictly positive denominator. Ignorethe ratios, when the pivotal column elements are zeroor negative.

Suppose bi

aijis the smallest non negative ratio

among these ratiosbi

aij,

b2

a2j, · · · bm

amj,

then the basic variable si will leave the basis (andtherefore will become a non basic variable). The ithrow is known as the pivotal row. The element aij

at the intersection of the pivotal column and pivotalrow is known as the pivotal element, which is encir-cled in the table step III. Compute the new simplextableauwith (s1, s2, · · · , xj , · · · , sm) as the new basiscompute.Pivot row:

New pivot row = current pivot rowpivot element .

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 newbasic solutionwith newobjective 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 themost negative (pos-itive) coefficient coefficient in the z-row will be theentering variable in a maximization (minimization)problem. Ties are broken arbitrarily. When all the z-row coefficients of the non basic variables are non-negative (nonpositive) then the current solution isoptimal.

Feasibility condition

In both the maximization and minimization prob-lems, the basic variable associated with the smallestnonnegative ratio (with strictly positive denomina-tor) will be the leaving variable.

Page 10: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.10 MATHEMATICAL METHODS

Thus the simplex method can be summarized asfollows:

Step 0. If all the constraints are less than or equalto type, introduce slack variables and determine thestarting basic solution.

Step I. Using optimality condition, select the enter-ing variable. If no variable can enter the basis, stop.The current solution is optimal.

Step II. Using feasibility condition determine theleaving variable.

Step III. Compute the new basic solution (new sim-plex tableau) and go to step I.

Artificial Variable Technique

For a LPP in which all the constraints are less than orequal to type with bi ≥ 0, an all-slack, initial basicfeasible solution readily exists. However for prob-lems involving ≥ inequalities or equality constrainsno such solution is possible. To alleviate this, artifi-cial variables are introduced in each of the ≥ or =type constraints, and slack variables for the less thanor equal to type which will then provide a startingsolution. The M-method and the two-phase methodare two closely related methods involving artificialvariables.

M-Method (also Known as Charne’s Methodor Big M-Method)

Since artificial variables are undesirable, the coeffi-cient for the artificial variable in the objective func-tion is taken as − M in maximization problem andas + M in minimization problems. Here M is a verylarge positive (penalty) value. The augmented prob-lem is solved by simplex method, resulting in one ofthe following cases:

1. When all the artificial variables have left the basisand optimality condition is satisfied, then the cur-rent solution is optimal.

2. When one or more artificial variables are presentin the basis at zero level and the optimality condi-tion is satisfied, then the solution is optimal withsome redundant constraints

3. No feasible solution exists when one or more arti-ficial variables are present in the basis at a positivelevel although the optimality condition is satis-fied. Such a solution is known as pseudo optimalsolution since it satisfies the constraints but doesnot optimize the objective function.

Note: Since artificial variables which is forced outof the basis, is never considered for reentry, the col-umn corresponding to the artificial variable may beomitted from the next simplex tableau.

Two-Phase Method

In the M-method, M must be assigned some specificnumerical value which creates trouble of roundofferrors especially in computer calculations. The z-coefficient of the artificial variablewill be of the formaM + b. For large chosen M, b may be lost and forsmall chosenMand small a, bmay be present leadingto incorrect results. The two phase method consistsof two phases and alleviates the difficulty in the M-method.

Phase I

Exactly as in M-method, introduce necessary artifi-cial variables to get an initial basic feasible solution.Solve this augmented problem, by simplex methodto minimize r, the sum of the artificial variables. Ifr = 0, then all the artificial variables are forced outof the basis. Goto phase II. If r > 0, indicating thepresence of artificial variables at non zero level, LPhas no feasible solution

Phase II

The feasible solution of phase I forms the initial basicfeasible solution to the original problem (without anyartificial variables). Apply simplex method to obtainthe optimal solution.

WORKED OUT EXAMPLES

Enumeration

Example 1: Solve the following LPP by enumerat-ing all basic feasible solutions. Identify the infeasible

Page 11: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.11

solutions. Find the optimal solution and the value ofthe objective function.

Maximize z = 2x1 + 3x2 + 4x3 + 7x4 subject to2x1 + 3x2 − x3 + 4x4 = 8x1 − 2x2 + 6x3 − 7x4 = −3and x1, x2, x3, x4 ≥ 0.

Solution: The number of equations m = 2. Thenumber of variable n = 4. The number of basic vari-ables = m = 2. The number of all possible solutionsis 4c2 = 6.1. Put x3 = x4 = 0, solving 2x1 + 3x2 = 8, x1 −

2x2 = −3, we get x1 = 1, x2 = 2, z = 8. Basicfeasible solution, not optimal, x1, x2 are basicvariables, x3, x2 are non basic variables (whichare always zero).

2. Put x2 = x4 = 0. Solving 2x1 − x3 = 8, x1 +6x3 = −3, we get x1 = 45

13 , x3 = − 143 . Since x3 <

0, this is a basic non feasible solution.

3. Put x1 = x4 = 0. Solving 3x2 − x3 = 8, −2x2 +6x3 = −3, we get x2 = 45

16 , x3 = 716 , z = 163

16 . Thisis a basic feasible solution (not optimal).

4. Put x3 = x2 = 0, solving 2x1 + 4x4 = 8, x1 −7x4 = −3, we get x1 = 22

9 , x4 = 79 , z = 93

9 , basicfeasible solution (not optimal).

5. Put x1 = x3 = 0. Solving 3x2 + 4x4 = 8, 2x2 +7x4 = 3 we get x2 = 44

13 , x4 = −713 . This is a basic

non feasible solution.

6. Put x1 = x2 = 0. Solving −x3 + 4x4 = 8, 6x3 −7x4 = −3, we get x3 = 44

17 , x4 = 4517 . Thus the opti-

mal basic feasible solution with the basic vari-ables x3 = 44

17 , x4 = 4517 (and obviously the remain-

ing non basic variables x1, x2 at zero value) hasthe maximum value of the objective function as49117 .

Simplex Method: Maximization

Example 1: Solve the following LPP by simplexmethod.

Maximize z = 2x1 + 3x2

subject to 2x1 + 4x2 ≤ 202x1 + 2x2 ≤ 124x1 ≤ 16x1 ≥ 0, x2 ≥ 0

Solution: Introducing three slack variables, thegiven three less than or equal to inequality constraintswill be expressed as equations. Assign zero cost toeach of these slack variables. Then the standard formof the LPP is toMaximize z = 2x1 + 3x2 + 0 · s1 + 0 · s2 + 0 · s3subject to

2x1 + 4x2 + s1 = 20

2x1 + 2x2 + s2 = 12

4x1 + s3 = 16

and x1, x2, s1, s2, s3 ≥ 0Express the objective equation as

z − 2x1 − 3x2 = 0

Then the starting simplex tableau is represented asfollows:

Basis Solution Remark

1 –2 –3 0 0 0 0 -row

0 2 4 1 0 0 20 -row

0 2 2 0 1 0 12 -row

0 4 0 0 0 1 16 -row

z x x s s s

z z

s s

s s

s s

1 2 1 2 3

1 1

2 2

3 3

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

2

x1

1

3

BA

E

x2

Doptimum ( = 2, = 4)

= 16x x

z

1 2

D

C

Fig. 5.2

The initial basis consists of the three basic vari-ables s1 = 20, s2 = 12, s3 = 16. The two non basicvariables are x1 = 0, x2 = 0. Note that non basic vari-ables are always equal to zero. Thus this solutioncorresponds to the corner (extreme) point A (0, 0) inthe graph. In the simplex tableau all the three basic

Page 12: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.12 MATHEMATICAL METHODS

variables are listed in the left-most (first) columnand their values (including the value of the objectivefunction), in the right-most (last) column. Here thevalue of OF is 0 since all the resources are unutilized.In the z-row, the value of the objective function in thesolution column is enclosed in a square. Since this isa maximization problem, to improve (increase) thevalue of z, one of the non-basic variables will enterinto the basis and there by forcing out one of thecurrent basic variable from the basis (since the num-ber of basic variables in the basis is fixed and equalsto m = 3 the number of constraints). From the opti-mality condition, the entering variable is one withthe most negative coefficient in the z-row. In the z-row the most negative elements is −3. Thus the nonbasic variablex2 will enter the basis. Todetermine theleaving variable, calculate the ratios of the right-handside of the equations (solution-column) to the corre-sponding constraint coefficients under the enteringvariable x2, as follows:

Basis Enteringx2

Solution Ratio

204

122

160

= 5 minimum

= 6

= � (Ignore)

S1

S2

S3

4

2

0

20

12

16

Therefore s1 is the leaving variable. The value ofthe entering variable x2 in the new solution equals tothis minimum ratio 5. Here s1-row is the pivot row;x2 column is the pivot column and the intersectionof pivot column and pivot row is the pivot element4 which is circled in the tableau. The new pivot rowis obtained by dividing the current pivot row by thepivot element 4. Thus the new pivot row is

04

24

44

14

04

04

204

i.e., 0 12 1 1

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) ++3

(0,

1

2, 1,

1

4, 0, 0, 5

)

= 1, − 1

2, 0,

3

4, 0, 0, 15

New s2-row = current s2-row−(2) new pivot row

= (0, 2, 2, 0, 1, 0, 12)−−2

(0, 1

2 , 1, 14 , 0, 0, 5

) == (0, 1, 0, − 1

2 , 1, 0, 2)

New s3-row = current s3-row-(0) × (new pivot row)

= current s3-row itself= 0, 4, 0, 0, 0, 1, 16Summarizing these results we get the new simplex

tableau corresponding to the new basis (x2, s2, s3) asfollows. Note that this new basis corresponds to thecorner point E(0, 5) with value of OF as 15.

Basis

12

12

34

12

14

z

x

s

x

2

2

3

1

0

0

0

0

1

0

0

0

0

1

0

0

0

0

1

15

5

2

16

1

4 0

z x1 x2 s1 s2 s3 solution

From the tableau, the solution isx2 = 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 solutionis not reached since all elements of z-row are notnon negative. Since − 1

2 is the most negative elementin the current z-row, the variable x1 will enter thebasis. To determine the leaving variable again calcu-late the ratios of RHS column with the elements ofthe entering variable x1.

12

x

s

x

2

2

3

Basis Solution RatioEnteringx1

1

4

5

2

16

10

2

4

mini-mum

Therefore, s2 will leave the basis. The pivotal ele-ment is one; so pivot row remain the same. The

Page 13: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.13

new simplex tableau corresponding to the new basis(x2, x1, s3) is given below.

12

12

12

12

12

Basis Solutionz x1 x2 s1 s2 s3

z

x

x

s

2

1

3

1

0

0

0

0

0

1

0

0

1

0

0

0

0

0

1

16

4

2

8

2

1

– 4

Here new z-row = current z-row− (− 12

)pivot row

=(1, − 1

2 , 0, 34 , 0, 0, 15

) ×× (− (− 1

2

)) (0, 1, 0, − 1

2 , 1, 0, 2) =

= 1, 0, 0, 12 ,

12 , 0, 16

Here new x2-row = (current x2 row) − 12 (pivot row)

=(0, − 1

2 , 0,34 , 0, 0, 15

) ×× − (1)

(12

),(0, 1, 0, − 1

2 , 1, 0, 2) =

=(1, 0, 0, 1

2 ,12 , 0, 16

)Here new s3-row = current s3-row − 4(pivot row)

= (0, 4, 0, 0, 0, 1, 16)

−4(0, 1, 0, − 1

2 , 1, 0, 2) =

= (0, 0, 0, 2, −4, 1, 8)Since all the elements in the current z-row are non-

negative, the current solution is optimal. Read thesolution 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 solutionmovedfrom E to D.

Simplex Method: Minimization:

Example 1: Minimize: z = x1 + x2 + x3 subjectto x1 − x4 − 2x6 = 5, x2 + 2x4 − 3x5 + x6 = 3,

x3 + 2x4 − 5x5 + 6x6 = 5.

Solution: Fortunately the problem contains alreadya starting basic feasible solution with x1, x2, x3 as the

basic variables.

Basis Solutionx2x1 x3 x4 x5 x6

z

x

x

z

x

1

3

1

x

x

x

z

x

x

x

2

2

6

1

4

6

– 1

1

0

0

– 1

1

0

0

– 1

1

0

0

0

– 2

1

6

0

0

0

1

0

0

0

1

– 1

0

1

0

– 1

0

1

0

– 1

– 1

0

0

1

– 1

0

0

– 3

– 5

0

13

5

3

5

0

– 1

2

2

0

15

310

6330

13

53

203

536

13

35

110

1310

1310

16

136

136

53

15

415

25

25

16

56

56

21330

13

– + –

– –

– –

– 1 00

0

1

0

21330

Optimal solution: x1 = 21330 , x4 = 13

10 , x6 =25 O.F : 213

30 .

Unbounded solution:

Example 1: Solve LPP by simplex method.Maximize: z = 2x1 − 3x2 + 4x3 + x4 subject tox1 + 5x2 + 9x3 − 6x4 ≥ −23x1 − x2 + x3 + 3x4 ≤ 10−2x1 − 3x2 + 7x3 − 8x4 ≥ 0and x1, x2, x3, x4 ≥ 0.

Solution: Rewriting in the standard form−x1 − 5x2 − 9x3 + 6x4 ≤ 23x1 − x2 + x3 + 3x4 ≤ 102x1 + 3x2 − 7x3 + 8x4 ≤ 0Introducting 3 slack variables x5, x6, x7 we write theLPP asmaximize: z = 2x1 − 3x2 + 4x3 + x4 + 0 · x5 + 0 ·x6 + 0 · x7subject to

−x1 − 5x2 − 9x3 + 6x4 + x5 = 2

3x1 − x2 + x3 + 3x4 + x6 = 10

2x1 + 3x2 − 7x3 + 8x4 + x7 = 0

Page 14: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.14 MATHEMATICAL METHODS

Objective equation is: z−2x1+3x2−4x3−x4 =0The first simplex tableau with the 3 basic variablesx5, x6, x7 is given below:

Basis Solutionx2x1 x3 x4 x5 x6 x7

z

x

x

x

5

6

7

– 2

– 1

3

2

3

– 5

– 1

3

– 4

– 9

1

– 7

– 1

6

3

8

0

1

0

0

0

0

1

0

0

0

0

1

0

2

10

0

Since −4 is most negative element in the z-row, theassociated variable x3 will enter the basis. Out of thethree ratios 2

−9 ,101 , 0

−7 , the first and third are ignored(because the denominator is negative). So x6 willbe outgoing variable. The pivotal element is 1. Sopivotal row remains same. The next simplex tableauwith x5, x3, x7 is given below.

Basis Solutionx2x1 x3 x4 x5 x6 x7

z

x

x

x

5

6

7

10

26

3

23

– 1

– 14

– 1

– 4

0

0

1

0

11

33

3

29

0

1

0

0

4

9

1

7

0

0

0

1

40

92

10

70

In the current z-row, x2 has the most negative coef-ficient − 1, so normally x2 should enter the basis.However, all the constraint coefficients under x2 arenegative, meaning that x2 can be increased indefi-nitely without violating any of the constraints. Thusthe problem has no bounded solution.

M-method:

Example 1: Solve the LPP by M-methodminimize z = 3x1 + 2.5x2

subject to2x1 + 4x2 ≥ 403x1 + 2x2 ≥ 50x1, x2 ≥ 0

Solution: Introducing surplus variables x3, x4, thegreater than inequations are converted to equations.Minimize z = 3x1 + 2.5x2 + 0 · x3 + 0 · x4

subject to2x1 + 4x2 − x3 = 403x1 + 2x2 − x4 = 50x1, x2, x3, x4 ≥ 0In order to have a starting solution, introduce twoartificial variables R1 and R2 in the first and secondequations. In the objective function the cost coeffi-cients for these undesirable artificial variablesR1 andR2 are taken as a very large penalty value M. Thusthe LPP takes the following form:Minimize z = 3x1 + 2.5x2 + 0 · x3 + 0 · x4+

+ M · R1 + M · R2 (1)subject to

2x1 + 4x2 − x3 + R1 = 40 (2)3x1 + 2x2 − x4 + R2 = 50 (3)

and x1, x2, x3, x4, R1, R2 ≥ 0The z-column is omitted in the tableau for conve-nience because it does not change in all the iterations.Solving (2) and (3) we get

R1 = 40 − 2x1 − 4x2 + x3 (4)

and R2 = 50 − 3x1 − 2x2 + x4 (5)

Substituting (4) and (5) in the objective function (1)we getz = 3x1 + 2.5x2 + M(40 − 2x1 − 4x2 + x3)

+ M(50 − 3x1 − 2x2 + x4)orz = (3 − 5M)x1 + (2.5 − 6M)x2 + M · x3++M · x4 + 90 · M

which is independent of R1 and R2. Thus the objec-tion equation isz − (3 − 5M)x1 − (2.5 − 6M)x2 − Mx3−−Mx4 = 90MThe simplex tableau with the starting basic solutioncontaining R1 and R2 as the basic variables in givenbelow:

Basis Solutionx1 x2 x3 x4 R1 R2

z

R

R

1

2

– 3+5M

2

3

– 2.5– 6M

4

2

– M

– 1

0

– M

0

– 1

0

1

0

0

0

1

90 M

40

50

In the z-row, the most positive coefficient is−2.5 + 6M . So x2 will be entering variable. Since404 = 10, 50

2 = 25, the variable R1 will leave the

Page 15: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.15

basis. So 4 is the pivotal element. New simplextableau is given below:

Basis Solutionx1 x2 x3 x4 R1 R2

z

x

R

2

2 2

0

1

0

– M

0

– 1

0

0

1

25+30M

40

50

– 3.5+4M2

2.5– 6M4

– 2.5+2M4

14

14

12

12

12

Since −3·5+4M2 is the most positive element in the z-

row, the variable x1 will enter the basis forcingR2 outsince the minimum of the ratios 10

12

= 20, 302 = 15 is

15. So pivotal element is 2. The next simplex tableauis shown below:

15

2054

78

78

316

3–16 M8

52

14

14

38

38

12

12

14

14

Basis Solutionx1 x2 x3 x4 R1 R2

– M

– –

––z

x

x

2

1

0

0

1

0

1

0

Since all the elements in the z-row are non posi-tive, the current solution is optimal given by x1 = 15,x2 = 5

2 with value of objective function 2054 (observe

that the artificial variables R1, R2 and surplus vari-ables x3, x4 are nonbasic variables assuming zerovalues. Thus R1, R2 have been forced out of thebasis).

Two-Phase Method

Example 1: Solve LPP by two-phase methodMaximize z = 2x1 + 3x2 − 5x3

subject tox1 + x2 + x3 = 72x1 − 5x2 + x3 ≥ 10and x1, x2, x3 ≥ 0

Solution: Phase I: Introducing a surplus variablex4 and two artificial variables R1 and R2, the PhaseI of the LPP takes the following form:Minimize r = R1 + R2 (1)subject tox1 + x2 + x3 + R1 = 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)

From (3), R2 = 10 − 2x1 + 5x2 − x3 + x4 (5)

Substituting (4), (5) in (1) we get the objection func-tion asMinimize r = (7 − x1 − x2 − x3) + (10 − 2x1 +5x2 − x3 + x4)or Minimize r = −3x1 + 4x2 − 2x3 + x4 + 17 orr + 3x1 − 4x2 + 2x3 − x4 = 17The simplex tableau containing the basic solutionwith R1, R2 as the basic variables is given below.

Basis Solutionx2x1 x3 R1 R2 x4

r

R

R

1

2

3

1

2

– 4

1

– 5

2

1

1

0

1

0

0

0

1

– 1

0

– 1

17

7

10

The variable x1 will enter the basis since 3 is mostpositive coefficient in the r-row of this minimizationproblem. The variable R2 will leave the basis since102 = 5 is less than 7

1 = 7. The pivotal element is 2.Dividing the pivot row by the pivot element 2, we getthe new pivot row as 1, − 5

2 ,12 , 0, 1

2 , − 12 , 5.

Here the new rth-row:= (3 − 4 2 0 0 − 1 17) − 3

(1 − 5

212 0 1

2 − 12 5

)= (

0 72

12 0 − 3

212 2

)Here the new R1-row:= (1 1 1 1 0 0 7) − 1

(1 − 5

212 0 1

2 − 12 5

)= (

0 72

12 1 − 1

212 2

)The new simplex table with R1 and x1 as the basicvariables is shown below:

Basis Solutionx2x1 x3 R1 R2 x4

r

R

R

1

2

0

0

1

0

1

0

2

7

5

72

12

32

12

72

12

12

12

12

12

12

52

Now x2 with most positive coefficient 72 , will enter

Page 16: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.16 MATHEMATICAL METHODS

the basis pushing out R1 with ratio 2(72

) = 47 . (The

other ratio 5− 5

2is ignored since the denominator is

negative). The pivotal element is 72 . The pivot row is(

0 1 17

27

−17

17

47

)Here new r-row:=

(0 7

212 0 −3

212 2

) − 72

(0 1 1

727 − 1

717

47

)= (0 0 0 − 1 − 1 0 0)Here new x1-row:= (

1 − 52

12 0 1

2 − 12 5

) −(− 52

) (0 1 1

727 − 1

717

47

)=

(1 0 6

757

17 − 1

7457

)The next simplex tableau of the second iteration withx1 and x2 as the basic variables is given below.

Basis Solutionx2x1 x3 R1 R2 x4

r

x

x

2

1

0

0

1

0

1

0

0– 1 00

17

27

17

17

47

67

57

17

17

457

– 1

The phase I is complete since r is minimized attain-ing value 0, producing the basic feasible solution x1

= 457 , x2 = 4

7 . Note that both the artificial variables R1

and R2 have been forced out of the (starting) basis.Therefore the columns of R1 and R2 can altogetherbe ignored in the future simplex tableau.

Phase II: Having deleted the artificial variablesR1 and R2 and having obtained a basic feasible solu-tion x1, x2 we solve the original problem given bymaximization of z = 2x1 + 3x2 − 5x3

subject tox2 + 1

7x3 + 17x4 = 4

7

x1 + 67x3 − 1

7x4 = 457

and x1, x2, x3, x4 ≥ 0The tableau associated with this phase II is

Basis Solutionx2x1 x3 x4

z

x

x

2

1

– 3

1

0

– 2

0

1

0

17

17

907

127

1027

47

67

17

457

5

+ =

Since x2 withmost negative element in the z-row is

already in the basis, the current solution is optimal.The basic feasible solution is x1 = 45

7 , x2 = 47 and

the maximum value of the objective function is 1027 .

5.6 LINEAR PROGRAMMING PROBLEM

EXERCISE

Enumeration:

1. If a person requires 3000 calories and 100 gmsof protein per day find the optimal product mixof food items whose contents and costs are givenbelow such that the total cost isminimum. Formu-late this as an LPP. Enumerate all possible solu-tions. Identify basic, feasible, nonfeasible, degen-erate, non degenerate solutions and optimal solu-tion.

Breadx1

Meatx2

Potatoesx3

Cabbagex4

Calories

Protein

Cost (Rs)

Milkx5

2500

80

3

3000

150

10

600

20

1

100

10

2

600

40

3

Ans: LPP: Minimize z = 3x1 + 10x1 + x3 + 2x4 +3x5.

s.t. 2500x1 + 3000x2 + 600x3 + 100x4 +600x5 = 300080x1 + 150x2 + 20x3 + 10x4 + 40x5 = 100,

x1, x2, x3, x4, x5 ≥ 0; m = 2, n = 5, 5c2 = 10basic solutions: F = Feasible, NF: non-feasible,D: degenerate, ND: non degenerate1. x1 = 10

9 , x2 = 227 , z = 110

7 , F, ND2. x1 = 0, x3 = 5, z = 5, F, D3. x1 = 20

17 , x4 = 1017 , z = 80

77 , F, ND4. x1 = 15

13 , x5 = 526 , z = 105

26 , F, ND, optimal,5. x2 = 0, x3 = 5, z = 5, F, ND6. x2 = 4

3 , x4 = −10, z = − 203 , NF, ND

7. x2 = 2, x5 = −5, z = 5, NF, ND8. x3 = 5, x4 = 0, z = 5, F, D9. x3 = 5, x5 = 0, z = 5, F, D

10. x4 = 10, x5 = −30, z = −30, NF, NDAll the remaining non basic variables are

zero.

Page 17: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.17

2. Find all basic solutions forx1 + 2x2 + x3 = 4, 2x1 + x2 + 5x3 = 5

Ans: (2, 1, 0) F, ND; (5, 0, − 1), NF, ND;(0, 5

3 ,23

)F, ND.

3. Find the optimal solution by enumerationMax: z = 5x1 + 10x2 + 12x3

s.t. x1, x2, x3 ≥ 0,15x1 + 10x2 + 10x3 ≤ 200, 10x1 + 25x2 +20x3 = 300

Ans: 1. (7.27, 9.1, 0, 0), z = 127 · 272. (5, 0, 12.5, 0), z = 1753. (30, 0, 0, −250), NF4. (0, −20, 40, 0), NF5. (0, 12, 0, 80), z = 1206. (0, 0, 15, 50), z = 180

(1) (2) (5) are F, ND:(6) is optimal solution;

4. Find the optimal solution by enumeration

Max: z = 2x1 + 3x2 s.t. 2x1 + x2 ≤ 4, x1, x2 ≥0, x1 + 2x2 ≤ 5.

Ans: 1. (0, 0, 4, 5), z = 0, F, ND2. (0, 4, 0, −3) NF3. (0, 2.5, 1.5, 0), z = 7.5, F, ND4. (2, 0, 0, 3), z = 4, F, ND5. (5, 0, −6, 0), NF6. (1, 2, 0, 0), z = 8, F, ND, optimal.

Simplex Method

Solve the following LPP by simplex method.

1. A firm can produce 5 different products using 3different input quantities, as follows.

Input Technical coefficients Capacityquantity 1 2 3 4 5

A 1 2 1 0 1 100B 0 1 1 1 1 80C 1 0 1 1 0 50

Profit 2 1 3 1 2

Maximize the profit

Ans: x1 = 20, x3 = 30, x5 = 50, profit: Rs = 30

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. Max: z = 2x1 + x2 s.t. x1, x2 ≥ 0; 3x1 + 5x2 ≤15; 6x1 + 2x2 ≤ 24.

Ans: x1 = 154 , x2 = 3

4 , z = 334

3. Max: z = 3x1 + 4x2 + x3 + 7x4 s.t. 8x1 + 3x2 +4x3 + x4 ≤ 7,

2x1 + 6x2 + x3 + 5x4 ≤ 3,x1 + 4x2 + 5x3 + 2x4 ≤ 8x1, x2, x3, x4 ≥ 0.

Ans: x1 = 1619 , x4 = 5

19 , x7 = 12619 , z = 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

6. Max: z = 5x1 + 4x2 s.t., x1, x2 ≥ 0;6x1 + 4x2 ≤ 24; x1 + 2x2 ≤ 6,x1 − x2 ≥ −1;−x2 ≥ −2

Ans: x1 = 3, x2 = 32 , 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.

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 = 96Multiple optima:

10. Minimize: z = −x1 − x2 s.t. x1, x2 ≥ 0x1 + x2 ≤ 2, x1 − x2 ≤ 1, x2 ≤ 1

Ans: x1 = 32 , x2 = 1

2 , z = −2

Page 18: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.18 MATHEMATICAL METHODS

Also another optimal solution is x1 = 1, x2 =1, z = −2

11. Max: z = 6x1 + 4x2 s.t. x1, x2 ≥ 0, x1 ≤4, 2x2 ≤ 12, 3x1 + 2x2 ≤ 18

Ans: x1 = 4, x2 = 3, z = 36Another optimal solution: x1 = 2, x2 = 6, z =36

Unbounded solution

12. Max: z = 4x1 + x2 + 3x3 + 5x4 s.t.3x1 − 2x2 + 4x3 + x4 ≤ 10,8x1 − 3x2 + 3x3 + 2x4 ≤ 20,−4x1 + 6x2 + 5x3 − 4x4 ≤ 20

Ans: Unbounded solutionNote: In the second simplex tableau, since x2 hasmost negative coefficient in z-row, normally x2

should enter the basis. But all the entries in thecolumn under x2 are negative or zero. So no vari-able can leave the basis. Hence the solution is notbounded

13. Min: z = −3x1 − 2x2 s.t. x1, x2 ≥ 0, x1 − x2 ≤1, 3x1 − 2x2 ≤ 6.

Ans: Unbounded solutionNote: In the 3rd simplex tableau, x3 having themost positive value (12) in z-row should normallyenter the basis. But all the entries under x3 arenegative. So OF can be decreased indefinitely.

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 = 52 , x4 = 0, z = 15

16. Min: z = 2x1 + x2 s.t. x1, x2 ≥ 0, 3x1 + x2 =3, 4x1 + 3x2 ≥ 6, x1 + 2x2 ≤ 3

Ans: x1 = 35 , x2 = 6

5 , z = − 125

17. Min: z = 3x1 − x2 s.t. x1, x2 ≥ 0, 2x1 + x2 ≥2; x1 + 3x2 ≤ 3; x2 ≤ 4

Ans: x1 = 3, x3 = 4, x6 = 4, z = 9

18. Max: z = x1 + 5x2 s.t. x1, x2 ≥ 0, 3x1 + 4x2 ≤6; x1 + 3x2 ≥ 2

Ans: x2 = 32 , x4 = 5

2 , z = − 152

19. Min: z = 2x1 + 4x2 + x3 s.t. x1 + 2x2 − x3 ≤5; 2x1 − x2 + 2x3 = 2;−x1 + 2x2 + 2x3 ≥ 1

Ans: x3 = 1, x4 = 6, x6 = 1, z = 1

Two-Phase Method:

20. Max: z = x1 + 5x2 + 3x3 s.t. x1, x2, x3 ≥ 0, andx1 + 2x2 + x3 = 3; 2x1 − x2 = 4

Ans: (2, 0, 1), z = 5

21. Min: z = 4x1 + x2 s.t. x1, x2, x3, x4 ≥ 0, and3x1 + x2 = 3; 4x1 + 3x2 ≥ 6, x1 + 2x2 ≤ 4.

Ans:(25 ,

95 , 1, 0

), z = 17

5

22. Minimize z = 7.5x1 − 3x2 s.t. x1, x2, x3 ≥0, 3x1 − x2 − x3 ≥ 3; x1 − x2 + x3 ≥ 2

Ans: x1 = 54 , x2 = 0, x3 = 3

4 , z = 758

23. Minimize z = 3x1 + 2x2, s.t. x1, x2, ≥ 0, x1 +x2 ≥ 2; x1 + 3x2 ≤ 3, x1 − x2 = 1

Ans: x1 = 32 ; x2 = 1

2 , z = 112

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 = 154 ; x3 = 5

4 , x5 = 30, z = −1254

25. Max: z = 2x1 + x2 + x3 s.t.4x1 + 6x2 + 3x3 ≤ 8;3x1 − 6x2 − 4x3 ≤ 1; 2x1 + 3x2 − 5x3 ≥ 4;x1, x2, x3 ≥ 0

Ans: x1 = 97 ; x2 = 10

21 , z = 6421

Page 19: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.19

5.7 THE TRANSPORTATION PROBLEM

The transportation problem is a special class of Lin-ear programming problem. It is one of the earliestand most useful application of linear programmingproblem. It is credited to Hitchcock, Koopmans andKantorovich. The transportation model consists oftransporting (or shipping) a homogeneous productfrom ‘m’ sources (or origins) to ‘n’ destinations,withthe objective of minimizing the total cost of trans-portation, while satisfying the supply and demandlimits.

Let ai denote the amount of supply at the ithsource, bj denote the demand at destination j ; cij

denote the cost of transportation per unit from ithsource to j th destination; xij the amount shippedfromorigin i to destination j . Then the transportationproblem is to minimize the total cost of transporta-tion

z =m∑

i=1

n∑j=1

cij xij (1)

subject to the constraints

source constraint :n∑

j=1

xij = ai,

ai > 0; i = 1, 2, . . . m (2)

Destination constraint:m∑

i=1

xij = bj , bj > 0; j = 1, 2, . . . , n (3)

and

xij ≥ 0 (4)

In the balanced transportation problem it is assumedthat the total quantity required at the destinations isprecisely the same as the amount available at theorigins i.e.

m∑i=1

ai =n∑

j=1

bj . (5)

(5) is the necessary and sufficient condition for theexistance of a feasible solution to (2) and (3).

Denoting the sources and destinations as nodesand routes as arcs, the transportation problem can berepresented as a network shown below:

Sm Dn

S1 D1 b1a1

b2a2

bnam

S2 D2

DemandDestinationsSourcesSupplyc x11 11;

c xmn mn;

The system of equations (1) to (4) is a linear pro-gramming problemwithm + n equations inmn vari-ables. The transportation problem always has a finiteminimum feasible solution and an optimal solutioncontains m + n − 1 positive xij ’s when there are m

origins and n destinations. It is degenerate if less thanm + n − 1 of the xij ’s are positive. No transportationproblem has ever been known to cycle.

Table for Transportation Problem

S1

S2

Si

Sm

bj

a

a

1

2

ai

am

bnbjb2b1� =ai

� bj

c1nc1jc12c11

cmncmjcm2cm1

x1nx1jx12x11

xmnxmjxm2xm1

��

aiDnDjD2D1 ��

Destinations

Sourc

es

Note: Zero values for nonbasic variables are notfilled while zero values for basic variables are shownin the tableau.

Like the simplex method the transport algorithmconsists of determining the initial basic feasible solu-tion, identifying the entering variable by the use ofoptimality condition and finally locating the leavingvariable by the use of feasibility condition.

Page 20: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.20 MATHEMATICAL METHODS

Determination of Initial (starting) Basic Fea-sible Solution

An initial basic feasible solution containingm + n −1 basic variables can be obtained by any one of thefollowing methods (a) the north west corner rule(b) row minimum (c) column minimum (d) matrixminimum (or least cost method) (e) Vogel approx-imation method. In general, Vogel’s method givesthe best starting solution. Although computationallynorth west corner rule is simple, the basic feasiblesolution obtained by this method may be far fromoptimal since the costs are completely ignored.

(a) North-west corner rule (due to Dantzig):

Step I:Allocate asmuch as possible to the northwestcorner cell (1, 1). Thus let x11 = min(a1, b1). If a1 ≤b1 then x11 = a1 and all x1j = 0 for j = 2, 3, . . . ni.e. except x11 all other elements of the first row arezero. The first row is satisfied so cross out the firstrow 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 thefirst column are zero. The first column is satisfiedso cross out the first column and move to x12 of thesecond column.

Note: If both a row and column are satisfied (i.e.,say x11 = a1 = b1) simultaneously, then cross outeither row or column only but not both row and col-umn.

Step II: Allocating as much as possible to the cell(2, 1) or (1, 2) cross out the row or column and moveto (3, 1) or (1, 3).Step III: If exactly one row or column is leftuncrossed out, stop. Otherwise go to step II whereinmove to lower row (below) if a row has just beencrossed out or move to right column if a column hasjust been crossed out.

Note: Cells from “crossed out” row or column cannot be chosen for basis cells at a later step in thedetermination of starting basic solution.

(b) Row-minimum

Identify the minimum cost element c1k in the firstrow. (Ties are broken arbitrarily). Allocate as muchas possible to cell (1, k). If a1 ≤ bk then x1k = a1 somove to the second row after changing bk to bk − a1.Identify the minimum element in second row andallocate as much as possible. Continue this processuntil 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, continuethe process until the first row is completely satisfied.

(c) Column-minimum

This is exact parallel to the above row-minimummethod except that minimum in the columns areidentified instead of rows.

(d) Matrix minimum (least-cost method):

Identify the least (minimum) element cij in theentire matrix. (Ties are broken arbitrarily). Allocateas much as possible to the (i, j )th cell. If ai ≤ bj

then xij = ai , change bj to bj − ai . If ai ≥ bj thenxij = bj , change ai to ai − bj . Identify the next leastelement and allocate as much as possible. Continuethis process until all the elements in the matrix areallocated (satisfied).

(e) Vogel approximation method

Step I. The row penalty for a row is obtained by sub-tracting the smallest cost element in that row fromthe next smallest cost element in the same row. Cal-culate the row penalties for each row and similarlycolumn penalties for each column.Step II. Identify the row or column with the largestpenalty (ties are broken arbitrarily). In the selectedrow or column, allocate as much as possible to thecellwith the least unit cost.Cross out the satisfied rowor column. If a row and column are satisfied simul-taneously, cross out either a row or column but notboth. Assign zero supply (or demand) to the remain-ing row (or column). Any row or column with zerosupply or demand should not be used in computingfuture penalties.

Page 21: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.21

Step III.

(a) A starting solution is obtained when exactly onerow or one column with zero supply or demandremains uncrossed out. Stop.

(b) Determine the basic variables in an uncrossedrow (column) with positive (non zero) supply(demand) by the least-cost method. Stop.

(c) Determine the zero basic variables in all theuncrossed out rows and columns having zero sup-ply and demand by the least cost method. Stop.

(d) Otherwise, go to step 1, recalculate the row andcolumn penalties and go to step II.

Note: Vogel’s method, which is a generalization ofthe matrix minimum (least cost method) gives bettersolution in most cases than all the other methodslisted above.

Method of Multipliers

The optimal solution to the transportation prob-lem is obtained by iterative computions using themethod of multipliers (also known as UV -methodor stepping-stone method or MODI (modified distri-bution) method). First of all, obtain a starting initialbasic feasible solution containing m + n − 1 basicvariables (by any one of the above methods).

Step I: Introduce unknownsui with row i and vj withcolumn 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). (Insteadof u1, any other variable ui or vj can be chosen aszero or one, resulting in the same optimal solutionbut with different values in the tableau). Solving theequations 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 allnon basic variables), stop. The current tableau givesthe optimal solution with minimum cost.

(b) If cij > 0, then solution is to be revised. Theentering variable is one which has most positive cij

(i.e., max cij for all i and j ).(c) The leaving variable is determined by con-

structing a closed θ -loop which starts and ends at theentering variable and consists of connected horizon-tal and vertical lines (without any diagonals). Thuseach corner of the loop lies in the basic cell, exceptthe starting cell. The unknown θ is subtracted andadded alternatively at the successive corners so asto adjust the supply and demand. From the cells inwhich θ is subtracted, choose the maximum valueof θ such that xij − θ ≥ 0. This feasibility conditiondetermines the leaving variable. Now go to step I.

Maximization A transportation problem in whichthe objective is to maximize (the profit) can be trans-fered to a minimization problem by subtracting allthe entries of the cost matrix from the largest entryof the matrix.

Unbalanced problem in which the total supply isnot equal to the total demand can always be trans-fered to a balanced transportation problem by aug-menting it with a dummy source or dummy destina-tion. A dummy destination is added when supply isgreater than the demand. The cost of transportationfrom any source to this dummy destination is takenas zero. Similarly when demand is greater than sup-ply, a dummy source is added. The cost of shippingfrom this dummy source to any destination is takenas zero. Now the corresponding balanced problem issolved by the method of multipliers.

Transhipment problem consists of transportingfrom source to destination via (through) intermedi-ate or transient nodes, known as transhipment nodeswhich act as both sources and destination. The tran-shipment node should be large enough to allow theentire supply or demand to pass through it. Thusthe ‘capacity’ of the transient node is the ‘buffer’amount which equal the total supply or demand.Thus the transhipment model consists of pure sup-ply nodes which tranship the original supply, puredemand nodes which receive the original demand,and transhipment node which can receive originalsupply plus the buffer or can tranship the originaldemand plus the buffer. A given transhipment prob-

Page 22: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.22 MATHEMATICAL METHODS

lem can be transformed to a regular transportationproblem as follows:

I. Identify the pure supply nodes, pure demandnodes and transhipment nodes from the given net-work.

II. Denote the pure supply nodes and transhipmentnodes as the sources.

III. Denote the pure demand nodes and transhipmentnodes as the destinations.

IV. Note down the transportation costs cij read fromthe given network. If ith source is not connected toj th destination, put cij = M where M is a large(penalty) value. Take cii = 0 since it costs zerofor transporting from ith source to itself (ith des-tination).

V. Identify supply at a pure supply node as the origi-nal supply; demand at a pure demand node as theoriginal demand; supply at a transhipment node asthe sum of original supply and buffer and finallydemand at a transhipment node as the sum of theoriginal demand and buffer.

Now the above transformed regular transportationproblem can be solved by using the method of mul-tipliers.

Degeneracy The solution of a transport problemis said to be degenerate when the number of basicvariables in the solution is less than m + n − 1. Insuch cases, assign a small value ε to as many non-basic variables as needed to augment to m + n − 1variables. The problem is solved in the usual waytreating the ε cells as basic cells. As soon as theoptimum solution is obtained, let ε → 0.

5.8 Transportation Problem

WORKED OUT EXAMPLES

Starting Solution:

Example 1: Obtain a (non artificial) starting basicsolution to the following transportation problemusing (a) North west corner rule (b) Row-minimum(c)Columnminimum (d) Least cost (Matrixminima)

(e) Vogel’s (approximation) method

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6 6

8

5

6

Solution:

(a) NWCR:

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6, 5 6

8, 1

5

6

7 1

5

6

Supply as much as possible to the north-west cornercell (1, 1).Cost: 7 × 0 + 1 × 4 + 5 × 3 + 6 × 0 = 19

Note: This is a degenerate solution because it con-tains only 4 basic variables (instead of 3 + 3 − 1 = 5basic variables).

(b) Row Minimum

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6, 1 6, 5

8, 1

5

6

7 1

1

5

5 1

Allot as much as possible in the first row to the cellwith least (minimum) cost i.e. (1, 1). The balanceallot 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 itcontains 3 + 3 − 1 = 5 basic variables).

Page 23: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.23

(c) Column Minimum

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6, 1 6, 5

8, 1

5

6

7 1

6

5

Cost: 7 × 0 + 1 × 2 + 5 × 4 + 6 × 2 = 34This is a degenerate solution containing 4 basic

variables.

(d) Least cost method (matrix minima)

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6, 1 6

8, 1

5

6

7 1

5

6

Allot as much possible to that cell which has leastcost in the entire matrix say (1, 1) (tie broken arbi-trarily between (1, 1) and (3, 3).

Cost: 7 × 0 + 1 × 4 + 5 × 3 + 6 × 0 = 19This is a degenerate solution.

(e) Vogel’s (approximation) method

S

S

S

1

2

3

0

2

1

4

3

2

2

4

0

D1 D2 D3

7 6 1 65

8 1

5

6

7

5

1

1 5

Row penalties

2

1

1

2

1

2

1

2

Columnpenalties

1 1

1

1

2

2

4

1

Cost: 7 × 0 + 2 × 1 + 3 × 5 + 2 × 1 + 0 × 5 = 19

This is a non-degenerate solution.

Method of Multipliers

Example 1: Solve the following transportationproblem by UV -method obtaining the initial basicsolution by (a) Vogel’s method (b) NWCR (c) com-pare the number of iterations in (a) and (b).

S

S

S

b

1

2

3

j

D1 D2 D3 D4 ai

3

0

2

0

1

5

1

2

0

2

4

0

10 25 30 35 100

30

20

50

(a) Initial solution by Vogel’s method

��

S

S

S

b

1

2

3

j

D1 D2 D3 D4 ai

3

0

2

0

1

5

1

2

0

2

4

0

10 2530 35

100

30

20

50

10

10

252525

10 10

20 10

20 10

Row penalties

1

1

2

2

1

2

2

1

2

3

Columnpenalties

2

2

3

1

1

1

1

2

2

2

2

1

Thus the initial basic feasible solution by Vogel’smethod is given by

S

S

S

1

2

3

D1 D2 D3 D4

3

0

2

0

1

5

1

2

0

2

4

0

10 10

25 25

20

where the basic variables are circledTotal cost: (20 × 0) + (10 × 2) + (10 × 0) +

(10 × 1) + (25 × 0) + (25 × 0) = 30In the UV -method (method of multipliers) asso-

ciate the multipliers ui and vj with row i and column

Page 24: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.24 MATHEMATICAL METHODS

j such that for each basic variable xij we haveui + vj = xij

Arbitrarily choosing u1 = 1 we solve for theremaining ui , vj ’s as follows:

Basic variable u, v equation solutionx13 u1 + v3 = 0 v3 = −1x14 u1 + v4 = 2 v4 = 1x34 u3 + v4 = 0 u3 = −1x32 u3 + v2 = 0 v2 = 1x23 u2 + v3 = 1 u2 = 2x21 u2 + v1 = 0 v1 = −2

To summarize u1 = 1, u2 = 2, u3 = −1v1 = −2, v2 = 1, v3 = −1, v4 = 1Now using ui and vj the non basic variables are

calculated asxij = ui + vj − cij

Thus

Nonbasic Valuevariable xij ui + vj − cij

x11 u1 + v1 − c11 = 1 − 2 − 3 = −4x12 u1 + v2 − c12 = 1 + 1 − 1 = 1x22 u2 + v2 − c22 = 2 + 1 − 2 = 1x24 u2 + v4 − c24 = 2 + 1 − 4 = −1x31 u3 + v1 − c13 = −1 − 2 − 2 = −5x33 u3 + v3 − c33 = −1 − 1 − 5 = −7

Non basic variables are placed in the south eastcorner of each cell. Then the new table is

S

S

S

b

1

2

3

j

D1 D2 D3 D4 ai

3

0

2

0

1

5

1

12

0

2

4

0

10 25 30 35

30

20

50–5

–4

25 25

– � + �

–�10

10

20��

–7

–1

v1 = –2 v3 = –1 v4 = 1v2 = 1

u1 = 1

u

u

2

3

= 2

= –1

101

During computation, it is not necessary to write u,v equations and solve themexplicitly. Instead, choos-ing u1 = 1, compute v3, v4 from the basic variablesx13, x14 in the first row. Now using v4, u3 is obtainedfrom the basic variable x34. Similarly u2 is obtainedusing v3 from the basic variable x23. Now using u2

we get v1 and finally using u3 we get v2.

Incoming: Amongst the nonbasic variables, theentering variable is the one with the most positivevalue (in the south east corner of the cell). Thus x21

will be the entering variable.Outgoing: The leaving (basic) variable is deter-mined by constructing a closed θ -loop which startsand ends at the entering variable x21. In this modifieddistribution all variables should be nonnegative andsupply and demand satisfied. Then

x14 = 10 − θ ≥ 0

x22 = 25 − θ ≥ 0

The maximum value of θ is 10 (which keeps bothx14, x22 nonnegative i.e., x14 = 0, x22 = 15 > 0).Thus the new table is

S

S

S

b

1

2

3

j

D1 D2 D3 D4 ai

3

0

2

0

1

5

1

2

0

2

4

0

10 25 30 35

30

20

50–4

–4

15 35

010 10

10 20

–6

–2

v1 = –2 v3 = –1 v4 = 0v2 = 0

u1 = 1

u

u

2

3

= 2

= 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. Theoptimal solution with least cost is (10 × 1) +(20 ×0)+(10 × 0)+(10 × 1)+(15 × 0)+(35 × 0) = 20.

(b) Initial solution by NWC rule: Suppressingthe working details we get the optimal solution in 3iterations.

3

0

2

0

1

5

1

2

0

2

4

0

15 35

10

15

2030

20

50

20

15

35

10 25 30 35

155

5

Associated cost= (10 × 3) + (20 × 1) + (5 × 2) + (15 × 1)+

+ (15 × 5) + (35 × 0) = 150

Page 25: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.25

By UV method with u1 = 1 we get

3

0

2

0

0 –7

–8

1

5

1

2

0

2

4

0

15 35

10

155

20

4 – +

66

��

v1 = 2 v3 = –1 v4 = –6v2 = 0

u1 = 1

u

u

2

3

= 2

= 6

with θ = 5, x22, is outgoing and x12 is the incom-ing variable.

Then the new table is

3

0

2

0

6 –1

–8

1

5

1

2

0

2

4

0

10 35

10

20

5

20

–2

+ –

– 6

0

q�

2 5 00

1

– 4

0

with cost 120. Now choose θ = 10, x13 will beincoming and x33 will be outgoing variable resultingin the following table.

3

0

2

0

–1

–2

1

5

1

2

0

2

4

0

35

10

20

15

10 10

4 0

0

2 – 1 00

1

2

0

– +

–��

– 6

choose θ = 10. Then x11 is outgoing and x21 isincoming with new following table which is the opti-mal solution since all xij = ui + vj − cij ≤ 0.

3

0

2

0

–1– 4

–2

1

5

1

2

0

2

4

0

35

10

15

10 20

0

– 4

–2 – 1 00

1

2

0– 6

10

optimal cost is 20. Optimal solution is x12 = 10,x13 = 20, x21 = 10, x23 = 10, x32 = 15, x34 = 35.

(c) The number of iterations is less when theinitial solution is obtained by Vogel’s method.

Unbalanced Transportation Problem

Example 1: Three electric power plants P1, P2, P3

with capacities of 25, 40 and 30 kWh supply electric-ity to three cites C1, C2, C3. The maximum demandat the three cities are estimated at 30, 35 and 25 kWh.The price per kWh at the three cites is given in thefollowing table

P

P

P

1

2

3

600

320

500

700

300

480

400

350

450

c1 c2 c3

City

Plant

During the month of August, there is a 20%increase in demand at each of the three cities, whichcan be met by purchasing electricity from anotherplant P4 at a premium rate of Rs 1000/- per kWh.plant 4 is not linked to city 3. Determine the mosteconomical plane for the distribution and purchaseof additional energy.Determine the cost of additionalpower purchased by each of the three cities.

Solution:

P

P

P

1

2

3

P4

600

320

500

1000

30+6

700

300

480

1000

35+7

400

350

450

M

25+5

25

40

70

13

148

c1 c2 c3

City

Apply Vogel’s method to obtain the initial solution.For all nonbasic variables ui + vj − cij ≤ 0. Thepresent table is optimal. The optimal solutionis P1C3 : 25, P2C1 = 23, P2C2 = 17, P3C2 = 25,P3C3 = 5, P4C1 = 13.Total cost: Rs 36,710 + Rs 13000 = Rs 49710 onlycity C1 purchases an additional 13 kWh power fromplant P4 at an additional cost of Rs 13,000/-.

Page 26: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.26 MATHEMATICAL METHODS

P

P

P

1

2

3

P4

25

40

30

13

c1 c2 c3

600

500

320

1000

700

480

300

1000

400

450

350

M

36 42 30523

13

25

25

23 17

5

17

Row penalties

200

20

30

M

100

20

20

M

� �

Columnpenalties

180

180

180

180

50

P

P

P

1

2

3

P4

25

40

30

13

c1 c2 c3

600

500

320

1000

700

480

300

1000

400

450

350

M

36 42 30

13

25

25

23 17

50

–20 – ve

–151

– 80

u1 = 0

u

u

u

2

3

4

= –129

= 51

= 551

v1 = 449 v2 = 429 v3 = 399

– 271

Transhipment Problem

Example 1: The unit shipping costs through theroutes from nodes 1 and 2 to nodes 5 and 6 via nodes3 and 4 are given in the following network. Solve thetranshipment model to find how the shipments aremade from the sources to destinations.

1

2

3 5

4 6

100

200

1 6

5

8

4

3

2

31

150

150

Solution: The entire supply of 300 units is tran-shipped 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 tranship-ment nodes; D6 is pure demand node. The tranship-mentmodel gets converted to a regular transportationproblemwith 5 sources P1, P2, T3, T4, D5 and 4 des-tinations T3, T4, D5 and D6. The buffer amount B =total supply ( or demand) = 100 + 200 = (or 150 +

150) = 300 units. A high penalty cost M is associatedwith cell cij when there is no route from ith origin tothe j th destination. Zero cost is associated with cells(i, i) which do not transfer to itself. The initial solu-tion is obtained byVogel’smethod. Takingu1 = 0 andM = 99 and applying method of multipliers we have

P

P

T

T

D

1

2

3

4

5

99

– 1

4

– 4

1 99

–2

99

1

23 99

99

– 92

1

– 92

0

– 90

6

8

90

0

3

– 2

5

92

199

– 196

99

– 195

0

150150

– �+�

00

300

300

200

100100

200

300

300

300

u1 = 0

u

u

u

u

2

3

4

5

= 2

= –91

= 0

= 97

T3 T4 D5 D6

v1 = 1 v2 = 0 v3 = 97 v4 = 98

300 300 450 150

value of objective function is Rs 2650. Not all cij ≤0. Note that c43 = 92 is most positive so the variablex43 will enter into the basis. To determine the variableleaving the basis, construct θ -loop from cells (4, 3)to (2, 3) to (2, 2) to (4, 2). Choose θ = 0 to maintainfeasibility. Adjusting θ = 0, the leaving variable isx23. Thus the new tableau is

p

p

t

t

d

1

2

3

4

5

99

–93

4

– 4

1 99

–94

99

– 91

23 99

–92

99

– 92

1

0

0

2

6

8

– 2

03

– 2

5

199

– 104

99

– 103

0

150150

+ �– �0

0

�300

300

200

100100

200

300

300

300

u1 = 0

2

1

0

– 5

t3 t4 d5 d6

v1 = 1 0 5 6

+ �– �

– �

300 300 150 150

value of objective function is Rs 2650. Not allcij ≤ 0. Note that c31 = 2 is most positive. So x31

is the entering variable. To determine the leaving

Page 27: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.27

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). Choosemaximum value of θ = 200. Then x21 will be theleaving variable. Adjusting θ = 200, the new tableauis given below.

p

p

t

t

d

1

2

3

4

5

99

–91

4

– 2

1 99

–92

99

– 91

23

– 2

99

–92

99

– 92

1

0

0 6

8

– 2

03

– 4

5

199

– 104

99

– 105

0

150150

100

200100

200

200

100 100

200

300

300

300

0

0

– 1

– 2

– 7

t3 t4 d5 d6

1 2 7 8

300 300 450 150

Observe that all cij ≤ 0. Therefore the currenttableau is optimal. The basic feasible optimalsolution 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

Maximization:

Example 1: Solve the following transportationproblem to maximize the profit.

D1 D2 D3

5

2

3

1

4

6

8

0

7

12

14

4

S1

S

S

2

3

9 10 11

Solution: To transform this problem to a minimiza-tion, subtract all the cost entries in the matrix fromthe largest cost entry 8. Then the relative loss matrixis

�3

6

5

7

4

2

0

8

1

12

14

4

3

2

1

9

2

10

2

11

1

Applying vogel’s method we get max penalty 3. Soallocate to (1, 3).

�3

6

5

7

4

2

0

8

1

12

14

4

4

2

3

9

2

10

2

11

11 1

Allocate to (1, 1) since 4 is the largest penalty

�3

6

5

7

4

2

0

8

1

12

14

4

4

2

3

9

2

10

2

11

11 1

Allocate to (3, 2) since 3 is the largest penalty.

3

6

5

7

4

2

0

8

1

1

14

4

2

3

98

10

2

11

111

1

3 3

6 6

5 5

7 7

4 4

2 2

0 0

8 8

1 1

14

8 6

111

4

8 6

4

1

Finally

11

The maximum profit (wrt the original costmatrix) is (1 × 5) + (11 × 8) + (8 × 2) + (6 × 4) +(4 × 6) = 157

Page 28: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.28 MATHEMATICAL METHODS

Degeneracy

Example 1: Solve the following TP using NWCR

0

2

1

4

3

2

2

4

0

8

5

6

S1

S

S

2

3

7 6 6

D1 D2 D3

Solution: By NWC rule

0

2

1

4

3

2

2

4

0

8

5

6

S1

S

S

2

3

7 6 6

D1 D2 D3

7 1

5

6

This is a degenerate solution since it contains only 4basic variables (instead of 3 + 3 - 1 = 5 basic vari-ables). To get rid of degeneracy, introduce any onenon-basic variable say in cell (3, 2) at ’ε’ level whereε is a small quantity. Thus

0

2

– 3 – 3

– 3

1

4

3

2

2

4

0

S1

S

S

2

3

D1 D2 D3

7 1

5

� 6

– 1 3 1

0u1 = 1

0

– 1

since all cij ≤ 0 current solution is optimal. Nowletting ε → 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 correspond-ing cost i.e. value of objective function: OF)

of the following transportation problems by (a)Northwest corner rule (b) Rowminimum (c) Col-umn minimum (d) Least cost method (e) Vogel’smethod.

1 5

0 2

3 3

2 1

4 4

1 6

6 8

2 0

5 7

7

12

11

12

14

4

10 910 1010 11

(i) (ii)

10

4

13

14

3

20

15

9

7

12

5

7

12

1

5

7

9

8

0

19

(iii)

60 60 20 10

10

20

30

40

50

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

Page 29: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.29

(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

2. Solve the following TP by method of multipliersmethod obtaining the starting solution by northwest corner rule.

(i) 3

0

2

3

0

0

2

5

4

0

4

1

1

1

0

3

1

1

6

0

30 60 50 40 20

40

70

60

30

Ans. x21 = 40, x21 = 10, x22 = 20, x24 = 40x31 = 20, x33 = 40, x43 = 10, x45 = 20 OF:70(ii) 1

3

4

2

3

2

1 5

2 4

5 6

4 2

1 3

9 2

20 40 30 10 50 25

30

50

75

203 1 7 43 6

Ans. x11 = 20, x13 = 10, x23 = 20, x24 = 10, x25 =20

x32 = 40, x35 = 10, x36 = 25, x45 = 20OF:430

3. Solve the above problem 2 (ii) by obtaining theinitial solution by (a) row minimum (b) col-umn minimum (c) matrix minimum (d) Vogel’smethod (e) compare the number of iterationsrequired in each of these methods including thenorth west corner rule.

Ans. Optimal solution and value of OF is same as in 2(ii) above for (a) (b) (c) (d). The number of itera-tions required are 7 in NWCR, 1 in rowminimum2 in column minimum, 1 in matrix minimum, 1in Vogel’s method.

4. Solve the TP by UV-method obtaining initialsolution by(a) NWC rule

Vogel’s method (c) compare the two meth-ods.

10

12

0

0

7

14

20

9

16

11

20

18

5 15 15 10

15

25

5

Ans. (a) x12 = 5, x14 = 10, x22 = 10, x23 = 15, x31 =5 OF: 315

(b) same (c) Vogel’s method give solutioncloser to optimal. Number of iterations requiredin Vogel is one while 3 in NWC rule.

5. Solve the following TP by method of multipli-ers by obtaining the starting solution by (a) NWCrule (b) Least-cost method (c) Vogel approxima-tion method. State the starting solution and thecorresponding value of OF.

10

12

4

2

7

14

20

9

16

11

20

18

5 15 15 15

15

25

10

S1

S

S

2

3

D1 D2 D3 D4

Ans. Starting solution and associated OF (a) x11 =5, x12 = 10, x22 = 5, x23 = 15,

x24 = 5, x34 = 10, OF: 520(b) x12 = 15, x14 = 0, x23 = 15, x24 =10, x31 = 5, x34 = 5, OF: 475(c) x12 = 15, x14 = 0, x23 = 15, x24 =10, x31 = 5, x34 = 5, OF: 475(d) Solution by UV method

x12 = 5, x14 = 10, x22 = 10, x23 =15, x31 = 5, x34 = 5, OF: 435

6. Solve the TP (use VAM)

21 25

17 14

16 13

18 23

6 10 12 15

11

13

1932 1827 41

D1 D2 D3 D4

S1

S

S

2

3

Page 30: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.30 MATHEMATICAL METHODS

Ans. x14 = 11, x21 = 6, x22 = 3, x24 = 4, x32 =7, x33 = 12 optimal minimum cost: Rs 796Degeneracy:

7. Solve the following TP.

9

7

6

12

3

5

9 9

7 5

9 3

6 10

7 5

11 11

4 4 6 2 4 2

5

6

2

96 8 11 22 10

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

Hint: The starting solution obtained by Vogel’smethod is a degenerate since it contains only 8basic variables (instead of 6 + 4 − 1 = 9 basicvariables). Introduce any one of the non basicvariable at ε level where ε is small and let ε → 0.

Maximization:8. Solve the following TP to maximize the profit

15 42

80 26

51 33

42 81

23 31 16 30

23

44

3390 6640 60

Ans. x12 = 23, x21 = 6, x22 = 8, x24 = 30,x31 = 17, x33 = 16, OF = 7005

Hint: Obtain the relative loss matrix by subtract-ing all the entries of the cost matrix from thelargest entry 90.

Unbalanced TP:

9. Solve the following unbalanced TP.

11 7

21 10

20 8

16 12

30 25 35 40

50

40

708 1812 9

D1 D2 D3 D4

S1

S

S

2

3

Ans. x13 = 25, x14 = 25, x23 = 10, x25 = 30,x31 = 30, x32 = 25, x34 = 15minimum cost = 1150

Hint: Total supply = 50 + 40 + 70 = 160Total demand = 30 + 25 + 35 + 40 = 130Introduce 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 sendto the dummy destination D5).

10. Solve the unbalanced TP;

5 7

6 6

1

4

75 20 50

10

80

153 52

D1 D2 D3

S1

S

S

2

3

Ans. x12 = 10, x21 = 20, x22 = 10, x23 = 50, x31 =15 minimum cost: 515

Hint: Introduce fictitious source S4 with supplyof 40. Demand of 40 units is not met at destina-tion 1.

Transhipment Problem

11. Solve the following transhipment problem

P1

P2

T1

D2

D3

D1

T2

1000

1200

3

4

2

5

8

6

4

93

5

800

900

500

Ans. P1T2 = 1000, P2T1 = 1200, T1D1 = 800

T1D2 = 400, T2D2 = 1000, D2D3 = 500

minimum cost = (1000 × 4) + (1200 ×2) + (800 × 8) + (400 × 6) + (100 × 4) ++(500 × 3) = 20, 700.

Page 31: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.31

Hint: The corresponding TP is given below:

3

2

0

M

M

M

4

5

7

M

0

M

M

M

8

0

M

M

M

M

6

5

4

0

M

M

M

M

9

3

P

P

T

T

D

D

1

2

1

2

1

2

T1 T2 D1 D2 D3

1000

1200

B

B

B

B

B B 800+B 900+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 caseof the transportation problem in which to each originthere will correspond one and only one destination.This can be described as a person-job assignment ormachine-task assignment model. Suppose there aren persons who can perform any of the n differentjobs with varying degree of efficiency measured interms of cij representing the cost of assigning the i thperson to j th job (i = 1, 2, 3, . . . n, j = 1, 2, . . . n)Then the objective of the assignment problem is tominimize the total cost of performing all then jobs byassigning “the best person for the job” on the one toone basis of one person to one job. The assignmentproblem can be solved as a regular transportationproblem in which the persons represent the sources,the jobs represent the destinations, the supply amountat each source and demand amount at each destina-tion being exactly equal to 1.

Letxij ={1 if ith person assigned to j th job0 if ith person not assigned to j th job

Since the ith person can be assigned to only one

job we haven∑

i=1xij = 1 for i = 1, 2, . . . n.

Since the j th job can be assigned to only one

person we haven∑

i=1xij = 1 for j = 1, 2, . . . , n. The

assignment problem consists of determining the inte-

gers xij (either 1 or 0) such that the total cost rep-

resented by the objective functionn∑

i=1

n∑j=1

cij xij is

minimized. Thus the assignment problem is an inte-ger linear programming problem. This combinato-rial problem has n! number of possible assignmentswhich can be enumerated for small n. Even for n =10, (n! = 3,628,800) the enumeration becomes verytime consuming and cumbersome.However the solu-tion to the assignment problem is obtained by a sim-ple method known as the “Hungarian method” or“Floods’ technique”.

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 columnof thegiven payoff (cost) matrix from all the entries ofthat corresponding column results in the column-opportunity cost matrix.

(b) Now subtracting the lowest entry of each row ofthe column-opportunity matrix (obtained in step(a) above) from all the entries of the correspond-ing row results in the total opportunity cost (TOC)matrix.

Step II. Check for optimal assignment: Let n bethe minimum number of horizontal and vertical linesrequired which cover ALL the zeros in the currentTOC 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 uncoveredcells) of the current TOC matrix from all theuncovered cells.

(b) Add this lowest entry to only those cells at whichthe covering lines of step II cross. This revisesTOC matrix.

Page 32: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.32 MATHEMATICAL METHODS

Step IV. Repeat steps II and III initial an optimalassignment is reached:

Step V. Optimal assignment:

(a) Identify a rowor column (in the final TOCmatrix)having only one zero cell.

(b) Make assignment to this cell. Cross off both therow and column in which this zero cell occurs.

(c) Repeat (a) for the remaining rows and columnsand make an assignment until a complete assign-ment is achieved.

2. Maximization case:

The maximization problem can be converted to aminimization problem by subtracting all the entriesof the original cost matrix from the largest entry (ofthe original cost matrix). The transformed entriesgive the “relative costs”.

3. Alternative Optima:

The presence of alternative optimal solutions is indi-cated by the existance of a row or column in the finalTOC matrix with more than one zero cells.

4. Unbalanced Problem:

When the cost matrix is rectangular, a dummy rowor a dummy column added makes the cost matrix asquare matrix. All the costs cij associated with thisdummy row (or column) are taken as zeros.

5. Problem with Restrictions:

When the assignment problem includes certainrestrictions such that a particular (specified) i th per-son can not be assigned to a particular j th job thenthe associated cost cij is taken as a very big value M

(generally infinity) so that it is prohibitively expen-sive to make this undesirable assignment.

WORKED OUT EXAMPLES

Example 1: A national highway project consistsof 5 major jobs for which 5 contractors have submit-ted tenders. The tender amounts (in lakhs of rupees)

quoted is given in the pay-off matrix below. If eachcontractor is to be assigned one job, find the assign-ment which minimises the total cost of the project.

1

2

3

4

5

120

140

50

75

110

150

80

40

65

90

75

90

40

45

140

90

85

70

70

115

100

170

110

90

100

Cont-ractor

Jobs

A B C D E

Solution: The column opportunity matrix isobtained by subtracting the lowest entry in each col-umn from all the entries in that column

1

2

3

4

5

70

90

0

25

60

110

40

0

25

50

35

50

0

5

100

20

15

0

0

45

10

80

20

0

10

A B C D E

Column-opportunity matrix

The total-opportunity-cost (TOC) matrix is nowobtained by subtracting the lowest entry from eachrow from all the entries in that row.

1 60 100 25 10 0

2 75 25 35 0 65

3 0 0 0 0 25

4 25 25 5 0 0

5 50 40 90 35 0

A B C D E

Toc Matrix

Since the minimum number of vertical and horizontallines (n) needed to cover all the zeros is less than thenumber of row m (or columns) i.e. n = 3 < m = 5,the current TOCmatrix is to be revised by subtractingthe lowest entry among the uncovered cells from allthe 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

Page 33: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.33

the uncovered cells and added at the crossed cells (3,4), and (3, 5). Then the revised TOC is

1 55 95 20 10 0

2 70 20 30 0 65

3 0 0 0 5 25

4 20 20 0 0 0

5 45 35 85 35 0

A B C D E

Here the minimum number of lines covering all thezeros is less than the number of rows i.e. n = 4 <

m = 5. Revise the matrix as above

1 35 75 0 10 0

2 50 0 10 0 65

3 0 0 0 25 45

4 20 20 0 20 20

5 25 15 65 35 0

A B C D E

Here n = 4 < m = 5

1 25 65 0 0 0

2 50 0 20 0 75

3 0 0 10 25 55

4 10 10 0 10 20

5 15 5 65 25 0

A B C D E

Optimal Toc matrix

n = 5 = m = 5Ist optimal assignment: choose a row (or column)containing only one zero. Choosing so the first col-umn, make an assignment. Thus

1 25 65 0 0 0

2 50 0 20 0 75

3 0 0 10 25 55

4 10 10 0 10 20

5 15 5 65 25 0

A B C D E

i.e. assign A to 3. Cross off first column and 3rd row.

Second and Third optimal assignment

1 25 65 0 0 0

2 50 0 20 0 75

3 0 0 10 25 55

4 10 10 0 10 20

5 15 5 65 25 0

A B C D E

Fromamong the remaining non-crossed out rows andcolumns, choose a row or columnwith only one zero.Thus assign B to 2 and D to 1. Cross off the 2 rowand 2 column and 4th column and first row.4th and 5th optimal assignment:

1 25 65 0 0 0

2 50 0 20 0 75

3 0 0 10 25 55

4 10 10 0 10 20

5 15 5 65 25 0

A B C D E

i.e. assign C to 4 and E to 5Thus the optimal assignment isA3, B2, C4, D1, E5with minimum cost = 50 + 80 + 45 + 90 + 100 = 365

Example 2: Maximization: The profit of assign-ing a particular job to a specific machine is given inthe following matrix. Maximize the profit to accom-plish all the jobs by assigning one machine to onejob. Check by enumeration.

1

2

3

380

210

260

610

380

210

330

415

300

A B CJob

Machine

Solution: To convert into a minimization problem,subtract all the entries of the matrix from the largestentry 610. Then

1

2

3

230

400

350

0

230

400

280

195

310

A B C

Page 34: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.34 MATHEMATICAL METHODS

Job opportunity column matrix

1 0 0 85

2 170 230 0

3 120 400 115

A B C

TOC matrix

1 0 0 85

2 170 230 0

3 5 285 0

A B C

n = 2 < m = 3Revised TOC matrix

1 0 0 90

2 165 225 0

3 0 280 0

A B C

n = 3 = m = 3Optimal assignment: A3, B1, C2

1 0 0 90

2 165 225 0

3 0 280 0

A B C

Maximum profit: 260 + 610 + 415 = 1285

Check by enumeration:

A1, B2, C3 : 380 + 380 + 300 = 1060

A1, B3, C2 : 380 + 210 + 415 = 1005

A2, B3, C1 : 210 + 210 + 330 = 750

A2, B1, C3 : 210 + 610 + 300 = 1120

A3, B1, C2 : 260 + 610 + 415 = 1285 Optimal solu-tion

A3, B2, C1 : 260 + 380 + 330 = 970

Example 3: Unbalanced problem: The amount oftime (in hours) to perform a job by different menis given below. Solve the unbalanced problem byassigning four jobs to three men subject to one job

to one man.

Men

M

M

M

1

2

3

J1

7

5

8

J2

5

6

7

J3

8

7

9

J4

4

4

8

Jobs

Solution: Add a fictitious (dummy) fourth man, toconvert the unbalanced to balanced assignment prob-lem. The amount of time taken by the fourth man istaken as zero for each job.

Men

M

M

M

1

2

3

M4

J1

7

5

8

0

J2

5

6

7

0

J3

8

7

9

0

J4

4

4

8

0

Jobs

TOC matrix

3 1 4 0

1 2 3 0

1 0 2 1

0 0 0 0

J J J J

M

M

M

M

1 2 3 4

1

2

3

4

n m= 3 < = 4

Revised TOC Matrix

2 0 3 0

0 1 2 0

1 0 2 2

0 0 0 1

J J J J

M

M

M

M

1 2 3 4

1

2

3

4

= 4 = = 4n m

Optimal assignment

2 0 3 0

0 1 2 0

1 0 2 2

0 0 0 1

M1

J J J J

M

M

M

1 2 3 4

2

3

4

Page 35: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.35

M1J4, M2J1, M3J2, M4J3

Thus the job J3 is not assigned. The minimumamount of time taken to accomplish all the three jobsis 4 + 5 + 7 = 16 hours.

Persons

P1

P2

P3

P4

M1

5

7

9

7

M2

5

4

3

2

M3

2

5

6

M4

2

3

7

Machines

Example 4: Assignment with restrictions: The fol-lowing matrix consists of cost (in thousands ofrupees) of assigning each of the four jobs to fourdifferent persons. However the first person can notbe assigned to machine 3 and third person can not beassigned to machine 4.(a) Find the optimal assignment to minimize the cost(b) Suppose a 5th machine is available the assign-ment costs to the four persons as 2, 1, 2, 8, respec-tively. Find the optimal solution(c) Is it economical to replace one of the existingmachines by the new (5th) machine(d) In such case which machine is to be replaced(unused). (A dash indicates that assignment is notpossible because of the restrictions imposed)

Solution: (a) Since first person can not be assignedto machine 3 a prohibitive (penalty) cost is imposed,denoted by ∞. Thus the cost matrix is

P1

P2

P3

P4

M1

5

7

9

7

M2

5

4

3

2

M3

2

5

6

M4

2

3

7

Row matrix

P1

P2

P3

P4

M1

3

5

6

5

M2

3

2

0

0

M3

0

2

4

M4

0

1

5

TOC Matrix Revised TOC

0

2

3

2

0

1

2

1

0

2

4

0

2

4

3

2

0

0

4

2

0

0

0

1

5

0

0

4

n = 3 < m = 4 n = 3 < m = 4Optimal assignment

0 5 0

1 3 0 0

1 0 1

0 0 3 3

M

P1 �

1 2 3 4

2

3

4

M M M

P

P

P

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 matrixis

P

P

1

5

P

P

P

2

3

4

M1

3

7

9

7

0

M2

5

4

3

2

0

M3

M4

2

3

7

0

M5

2

1

2

8

0

Subtracting the row minimums from each row, weget

3 3 0 0

6 3 1 2 0

7 1 3 0

5 0 4 5 6

0 0 0 0 0

L

N

MMMMMM

O

Q

PPPPPP

3

5

6

4

0

4

3

1

0

1

0

2

3

0

0

1

4

0

0

0

0

5

1

M1

P1

P

P

P

P

2

3

4

5

M2 M3 M4 M5

n m= 4 < = 5 n m= 5 = 5

optimal matrix

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 costhas come down from 14 to 8. So it is economical tointroduce 5th machine.

Page 36: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

5.36 MATHEMATICAL METHODS

(d) Since the dummy person P5 is assigned tomachine 1, it means that M1 is not used and thereforecan be replaced (dispensed with).

5.11 ASSIGNMENT PROBLEM

EXERCISE

1. Solve the following assignment Problem for min-imum total cost. Check by enumeration.

1

2

3

A

380

210

260

B

610

380

210

C

330

415

300

Job

Machine

Ans. A2, B3, C1: minimal cost: 750A1B2C3(1060), A1B3C2(1005), A2B1C3(1120),A2B3C1(750), A3B1C2(1285), A3B2C1(970).

2. Find the optimal solution with minimum cost inthe following assignment problem

O

O

O

1

2

3

20

10

14

27

18

16

30

16

12

Origins D1 D2 D3

Destinations

Ans. O1 to D2, O2 to D1; O3 to D3

Total minimum cost: 49

3. Find the optimal assignment which maximizesthe total cost in the above problem 2.

Ans. O3 to D1, O2 to D2, O1 to D3, maximum cost: 62Solve the following assignment problem for

minimum cost

4.

P

P

P

1

2

3

15

9

10

10

15

12

9

10

8

Person J1 J2 J3

Jobs

Ans: P1 to J2, P2 to J1, P3 to J3, minimum cost: 27

5.

P

P

P

1

2

3

P4

1

9

4

8

4

7

5

7

6

10

11

8

3

9

7

5

Persons J1 J2 J3 J4

Jobs

Ans. P1 to J1, P2 to J3; P3 to J2, P4 to J4 minimumcost: 21

6. Assign the five jobs to the five machines so as tomaximize the total return if the following matrixshows the return in (thousands of) 1 rupees forassigning the ith machine (i = 1, 2, 3, 4, 5) to thej th job (j = 1, 2, 3, 4, 5).

Machine 1 2 3 4 5

1 5 11 10 12 4

2 2 4 6 3 5

3 3 12 5 14 6

4 6 14 4 11 7

5 7 9 8 12 5

Job

Ans. M1 J3; M2 J5; M3 J4; M4 J2; M5 J1, Maximumcost: 50

7. Four men can perform any of the four tasks withdifferent efficiency measured in terms of timerequired to complete each task which is given inthe following table. Assign one task to one manso as to minimize the total time spent on accom-plishing the four tasks.

Men

Task

18 26 17 11

13 28 14 26

38 19 18 15

19 26 24 10

M

T

T

T

T

1 2 3 4

1

2

3

4

M M M

Ans. M1 to T2; M2 to T3; M3 to T1; M4 to T4, minimumtotal time = 59

Page 37: Linear Programming

chap-5a B.V.Ramana September 13, 2006 17:59

LINEAR PROGRAMMING 5.37

8. Multiple Optima: Solve the following assignmentproblem for minimum cost.

20 13 7 5

25 18 13 10

31 23 18 15

45 40 23 21

M

M

M

M

1

2

3

4

Jobs J J J J1 2 3 4

Men

Ans. Four optimal assignments all with the same min-imum total cost: 76.

(i) M1J1;M2J4;M3J2;M4J3.(ii) M1J2;M2J1;M3J4;M4J3.(iii) M1J1;M2J2;M3J4;M4J3.(iv) M1J4;M2J1;M3J2;M4J3.

9. Unbalanced assignment problem Three workcenters are required tomanufacture, assemble andto package a product. The handling cost at eachof the four locations in the factory are given inthe following matrix. Determine the location ofwork centres that minimizes total handling cost.

Job

Manufacturing 18 15 16 13

Assembly 16 11 – 15

Packaging 9 10 12 8

L L L L

M

M

M

1 2 3 4

1

2

3

Locations

Ans: M1 to L4;M2 to L2;M3 to L1. Location 3 is keptidle (assigned to dummy job and no job is done).

10.

A B C D E

M

M

M

M

1

2

3

4

62 78 50 101 82

71 84 61 73 59

87 92 111 71 81

48 64 87 77 80

Jobs

Men

Maximize the profit. Which job should bedeclined?

Ans. M1D;M2B;M3C;M4E, M5 A. Since (dummyman) M5 is assigned to job A, the job A shouldbe declined. Maximum profit: 101 + 84 + 111 +80 = 376

11. With Restrictions Suppose five men are to beassigned to five jobs with assignment costs givenin the following matrix. Find the optimal assign-ment schedule subject to the restriction that firstperson M1 can not be assigned job 3 and thirdperson M3 can not be assigned to job 4.

Jobs

Men

5 5 – 2 6

7 4 2 3 4

9 3 5 – 3

7 2 6 7 2

6 5 7 9 1

J J J J J

M

M

M

M

M

1 2 3 4 5

1

2

3

4

5

Ans. Minimal cost is 15with three alternative optimumsolutions.

(i) M1J4, M2J3, M3J2, M4J1, M5J5

(ii) M1J4, M2J3, M3J5, M4J2, M5J1

(iii) M1J4, M2J3, M3J2, M4J5, M5J1

12. Determine optimal location of three machines atfour different locations in a shop floor given thecost estimate per unit of time of material han-dling is given in the following matrix. Note thatmachine 2 can not be placed in location 2.

Machines 2 3 4

M1 12 9 12 9

M2 15 - 0 20

M3 4 8 115 6

L1 L L L

Locations

Ans. M1 to L2 or L4; M2 to L3, M3 to L1

Dummy (fictitious) machine M4 is assignedto location L4 or L2.

Minimum cost: 9 + 13 + 4 = 26


Recommended