0% found this document useful (0 votes)
12 views120 pages

Linear Programming

Uploaded by

ajayrocky167
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views120 pages

Linear Programming

Uploaded by

ajayrocky167
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 120

LINEAR PROGRAMMING

Introduction

In 1947 George Dantzig and his associates while working in the US


Department of Air force, observed that a large number of military
programming and planning problems could be formulated as maximizing
or minimizing a linear form of profit/cost.

At the same time they have observed that this cost or profit is the linear
function of variables. The programming refers to the process of
determining a particular programme or plan of action.

Definition

In general LP (Linear Programming) is the method of optimizing a linear


function of variables called Objective Function subject to a set of linear
equations and/or in equalities called the constraints or restrictions.
Solution for LPP

Basically there are two different methods to solve the linear programming
problems namely graphical method and Simplex method.

If the number of variables are two one can solve the problem by either
graphical method or simplex method.

If the number of variables is more than two, one must use the simplex
method to solve the LPP.

In that case (No of variables > 2) we cannot represent all those variables on
a graph, so one must use simplex method.
PROPERTIES OF LINEAR PROGRAMMING MODEL

Any linear programming model (problem) must have the following


properties:

(a) The relationship between variables and constraints must be linear.

(b) The model must have an objective function.

(c) The model must have structural constraints.

(d) The model must have non-negativity constraint.


Assumptions in LPP

The following are some important assumptions made in formulating a


linear programming model:

 It is assumed that the decision maker here is completely certain (i.e.,


deterministic conditions) regarding all aspects of the situation, i.e.,
availability of resources, profit contribution of the products,
technology, courses of action and their consequences etc.

 It is assumed that the relationship between variables in the problem


and the resources available exhibits linearity. Here the term linearity
implies proportionality and additivity.

 We assume here fixed technology. Fixed technology refers to the fact


that the production requirements are fixed during the planning period
and will not change in the period.
It is assumed that the profit contribution of a product remains constant,
irrespective of level of production and sales.

It is assumed that the decision variables are continuous. It means that


the companies manufacture products in fractional units.

It is assumed that only one decision is required for the planning period.

All variables are restricted to nonnegative values


Formulation of Linear Programming Problem
Problem: A firm manufactures two types of products A and B and sells them
at a profit of Rs 2/- on type A and Rs 3/- on type B. Each product is
processed on two machines G and H. Product A requires 1 minute of
processing time on G and 2 minutes on H. Product B requires one minute
processing time on G and one minute on H. The machine G is available for
not more than 6 hours 40 minutes, while machine H is available for 10
hours during any working day. Formulate the problem as a linear
programming problem to maximize the profit

Solution

From the description of the problem one can understand that the objective is
to maximize the profit.

So one has to find out how many number of product A and product B items
to be produced to get the maximum profit.
As we don’t know the number of items of product A and Product B to be
produced, let us assume

The number of items of product A to be produce = x

The number of items of product B to be produce = y

Now the profit on one item of type A is Rs 2 and the number of items of type
A are x.

So the total profit on Product type A = 2x

Similarly the profit on one item of type B is Rs 3 and the number of items of
type A are y.

So the total profit on Product type B = 3y

Now the total profit on both Product A and B is = 2x + 3y, and it should be
maximized and let the total profit is Z

So the objective function is Maximize Z = 2x + 3y


The objective function is

Maximize Z = 2x + 3y
Now with increase in the values of x and y the value of z or profit will goes
on increase

But there are the restrictions on the production time of machines G and H.
Let us see the restrictions now.

Number of items of type A produce are x and for each item processing time
required on machine G is 1 minute.

So Total time required by x items of product A on machine G = 1.x

Number of items of type B produce are y and for each item processing time
required on machine G is 1 minute.

So Total time required by y items of product B on machine G = 1.y

So Total time required by products A and B on machine G = 1.x + 1.y


But the total available time on machine G = 6 h 40 min = 400 minutes

So 1 𝑥 +1 𝑦 ≤ 400 or 𝑥+ 𝑦 ≤ 400
Similarly

Each item of product A requires 2 minutes processing time on H and each


item of product B requires 1 minute of processing time on H

So the total processing time of the products A and B on machine H = 2x + y

But the total available time on machine H = 10 h = 600 minutes

So 2 𝑥+ 𝑦 ≤ 600

At the same time one can produce the items but negative production is
meaning less and is not acceptable in OR.
Therefore 𝑥≥0, 𝑦 ≥0
Now the problem is Maximize Z = 2x + 3y
Another way of formulate the above problem

Prepare the table as below

Time required by Products


Machine Available
time
Type A Type B (minutes)
x units y units
G 1 1 400
H 2 1 600

Profit Rs 2 Rs 3
per Unit

𝑀𝑎𝑥 𝑍=2 𝑥+3 𝑦


𝑆𝑇 𝑥 + 𝑦 ≤ 400
2 𝑥+ 𝑦 ≤ 600
𝑥, 𝑦 ≥0
A company produces two types of hats. Each type of the
first hat requires twice as much labor time as the second
type. If all hats are of the second type only, the company
can produce a total of 500 hats a day. The market limits
the daily first and second type to 150 and 250 hats.
Assuming that the profits per hat are Rs 8 for first type
and Rs 5 for second type. Formulate the problem.

Identify the decision variables

Let the number of hats of first type = x


Number of hats of second type = y

Let the time required for second type of hat = 1 unit


Then the time require by first type of hat = 2 units
Total Profit on first type of hats = 8x
Total Profit on second type of hats = 5y

Net profit = 8x + 5y
Market limit on the first type of hat is x ≤ 150
Market limit on the second type of hat is y ≤ 250

Based on time x = 2y

Subjected to
A firm can produce 3 types of cloth A, B and C. Three kinds
of wool Red, Green and Blue are required for it. One unit
length of type A cloth requires 2 meters of red wool and 3
meters of blue wool. One unit length of type B cloth requires
3 meters of red wool, 2 meters of blue wool and 2 meters of
green wool. One unit of type C cloth needs 5 meters of green
wool and 4 meters of blue wool. There is 50 meters of red
wool, 80 meters of green wool and 60 meters of blue wool
available. It is assumed that the income obtained from one
unit length of type A cloth is Rs 3, of type B cloth is Rs 5 and
of type C cloth is Rs 4. Formulate the problem.

Identify the decision variables


Let
Number of units of type A cloth produced = x
Number of units of type B cloth produced = y
Number of units of type C cloth produced = z
Prepare the table with given data
Type of Wool length required Available
wool Cloth type Cloth type Cloth type length of
A (x units) B (y units) C (z units) wool
2 3 0 50
Red wool 0 2 5 80
Green wool 3 2 4 60
Blue wool Rs 3 Rs 5 Rs 4
Profit
Now the objective function is Max Z = 3x + 5y + 4z
Restrictions are

Based on availability of red wool 2 𝑥+3 𝑦 +0 𝑧 ≤50


Based on availability of green wool 0 𝑥 +2 𝑦 +5 𝑧 ≤ 80
Based on availability of blue wool 3 𝑥+2 𝑦 +4 𝑧 ≤ 60
Final Mathematical model is

Subjected to
A patient consult a doctor to check up his health. Doctor
examines him and advises him to take two vitamins, vitamin A
and vitamin D regularly for a period of time so that he can
regain his health. Doctor prescribes tonic X and tonic Y, which
are having vitamin A, and D in certain proportion. Also advises
the patient to consume at least 40 units of vitamin A and 50
units of vitamin D daily. The costs of tonics X and Y per unit
are Rs 5 and 3 respectively. X contains 2 units of A and 3
units of D and Y contains 4 units of A and 2 units of D.
Formulate LPP to minimize the cost of tonics.

Decision variables are

= The number of units of tonic X purchased

= The number of units of tonic Y purchased

Now prepare the table by using the given data


Vitamins Tonics Daily
X( Y( requirement
in units

A 2 4 40
D 3 2 50
Cost in Rs 5 3
per Unit
Objective function is 𝑀𝑖𝑛 𝑍=5 𝑥 1+ 3 𝑥2
Subjected to 2 𝑥1 + 4 𝑥 2 ≥ 40
3 𝑥 1+ 2 𝑥 2 ≥ 50

𝑥1 𝑎𝑛𝑑 𝑥 2 ≥ 0
Solve the following LPP
Max Z = 3x + 5y
Subjected to x + 2y ≤ 2000, x + y ≤ 1500, y ≤ 600 and x, y ≥ 0

As x and y are greater than or equal to zero, The solution space must be in the first
quadrant . Now go to the constraints

1st constraint is x + 2y ≤ 2000, The maximum limiting condition for this constraint
is
x + 2y = 2000

From this equation we can get two points


If x = 0, y = 1000
If y = 0, x = 2000.

So the equation x + 2y = 2000 can be represented by a line joining the points (0,
1000) and (2000, 0)

Similarly the equation x + y = 1500, obtained from the second constraint can be
represented by the line joining the points (0, 1500) and (1500, 0)

In the same way by converting the in-equation given as the third constraint will be
converted into equation y = 600 and it can be represented by a horizontal line
passing through the point (0, 600) on y axis

Based on this data draw the graph


x
2200 Here all the points below
the line AB satisfies the The area OEGHD is the
2100 common area in which all
2000 1st constraint. Similarly
the points below the line the points satisfies all the
1900 constraints
CD satisfies the 2nd
1800
constraint and points
1700 below the line EF satisfies Now find the co ordinates of
1600 the third constraint the extreme points
1500 C
1400 E = (0, 600) G = (800, 600)
1300 H=(1000, 500) D=(1500, 0)
1200
1100 A Now find out the Z values
1000 at all these four points
900
Z (E) = 3*0 + 5*600 = 3000
800
700 E Z (G) = 3*800 + 5*600 = 5400
600 F
500 G
H Z (H) = 3*1000 + 5*500 = 5500
400
Common Area
300 Z (D) = 3*1500 + 5*0 = 4500
200
100 O D B So the Maximum value of
y
0 Z is 5500
0 200 400 600 800 100012001400160018002000 2200 at x = 1000 and y = 500
Solve the following LPP
Min Z = S.T

Initially take the first in equation as equation

𝐼𝑓 𝑥 2=0 , 𝑥 1=3
So the equation is represented by a line joining (0, 1) and (3, 0)
And the area above the line in the graph satisfies the in equation

Similarly take the second in equation as equation

So the equation is represented by a line joining (0, 2) and (2, 0). And the
area above the line in the graph satisfies the in equation
Now draw the graph based on the above data All the points in the
common area (Above
ABC) satisfies all the
constraints

Now take the co-ordinates of A,


𝑥2 B, C which are the extreme
points of common area at the
lower boundary because
problem is minimization type

A (0,2), B (1.5, 0.5), C (3,0)


A
Now Z(A) = 1.5*0 + 2.5*2 = 5
Common Area (Area above ABC) Z(B) = 1.5*1.5 + 2.5*0.5 = 3.5
Z(C) = 1.5*3 + 2.5*0 = 4.5
B
So the minimum value of Z is at point B &
C
𝑥1
Solve the following LPP

First of all consider the first in-equation and write it as equation

So the line joining the points (0, -1) and (1,0) represents the above
equation

Similarly write the second in-equation as equation

So the line joining the points (0, 3) and (3, 0) represents the above
equation
Represent the above lines on the graph

All the points on the line (a) satisfies the first equation and the points above the line
satisfies the first in equation or constraint

Similarly all the points on the line (b) satisfies the second equation and the points
above the line satisfies the second in equation or constraint

𝑥2 The Area above the Points A and B is the


common area as shown in the diagram
Common a
Area The lower boundary points of common
A
area are A and B.

B
The problem is maximization type and there
is no limit for the upper boundary

So the solution is said to be UNBOUNDED


b

𝑥1
Solve the following LPP , ST

First of all consider the first in-equation and write it as equation

So the line joining the points (0, 1) and (1,0) represents the above equation

Similarly write the second in-equation as equation

So the line joining the points (0, 2) and (2, 0) represents the above equation

Represent the above constraints graphically


All the points on the line AB satisfies the equation and the points below the line
satisfies the in-equation

All the points on the line CD satisfies the equation 2 and the points below the line
satisfies the in-equation 4

So there is no common point


or common area that
𝑥2 satisfies both the constraints

So the solution to the


C problem is said to be
INFEASIBLE

B D 𝑥1
𝑀𝑎𝑥 𝑍=8000 𝑥 1 +7000 𝑥2
Subjected to 3 𝑥 1+ 𝑥 2 ≤66 45 𝑥1 ≤ 20𝑥 2 ≤ 40𝑥1 , 𝑥2 ≥ 0
𝑀𝑎𝑥 𝑍=𝑥 1+ 𝑥 2
Subjected to 𝑥1 − 𝑥 2 ≥ 0 −3 𝑥 1 + 𝑥2 ≥ 3 𝑥1 , 𝑥2 ≥ 0
Simplex Method
Algorithm
Step 1: Express the problem in standard form

 Convert the right hand side of the constraints into non-negative values.

 Convert the in- equations into equations by adding slack variables to the left hand
side of the constraints if the constraints are less than are equal to type. Subtract
the surplus variables from the left hand side of the constraints if the constraints
are greater than or equal to type.

 All the variables appear in the constraints should appear in the objective function.
So multiply the slack variables or surplus variables with zero and add it to the
objective function because there should not be any change in the objective function
due to slack or surplus variables.

 If the surplus variables are appears in the problem Artificial Variables should be
introduced (Discussed Later).

Step 2: Find the Initial Basic Feasible Solution (IBFS)

 As the minimum values of decision variables are zero, substitute zero in place of
decision variables and find out the values of slack variables. It becomes the IBFS.
Then form the simplex table.
Simplex Table

b θ
Basic Body matrix Identity matrix
Variables
0
0

𝑐 𝑗 =𝐶𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑖𝑛 𝑡h𝑒 𝑜𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛


𝐶 𝐵=𝐶𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑏𝑎𝑖𝑠𝑐𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑖𝑛 𝑡h𝑒 𝑜𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
𝑏=𝐼𝑛𝑖𝑡𝑖𝑎𝑙 𝐵𝑎𝑠𝑖𝑐 𝐹𝑒𝑎𝑠𝑖𝑏𝑙𝑒𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛
𝜃= 𝑀𝑖𝑛𝑖𝑚𝑢𝑚𝑟𝑎𝑡𝑖𝑜

𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 𝑖𝑗
Significance of the above terms will be explained wile solving the problem
Step 3: Perform the optimality test
 Find the value of Zj for each column of the simplex table

 Determine the value of for each column


 If all the values of are non-positive (Either zero or negative) the solution (IBFS) is
said to be optimum. If the value of for any column in the simplex table is positive
the IBFS is not optimum and one has to move towards optimum solution

Step 4: Iterate towards optimal solution.


If the value is positive follow the procedure below
 Select the column having maximum positive value of ( ) as key column

 Divide the column b with key column to get minimum ratio θ.

 Select the row having minimum non negative θ value as key row

 Select the element at the intersection of key column and key row as key element
and made it Unity (1). Made all other elements of key column zero by conducting
row operations in the simplex table. Row operation will affect body matrix, identity
matrix and column b only.

 Again conduct the optimality test and repeat the above procedure till optimum
solution is obtained.
Problem: Solve the following LPP by Simplex Method

Subjected to , , ,

Write the problem into standard form.


 Convert the right hand side of the constraints into non-negative form.

 In this problem all the values in the right hand side of the constraints is positive.
So there is no need of this step. Then Convert all the in-equations into equations.

 In this problem the constraints are ≤ type, so to convert the constraints into
equations by adding a variable to the left hand side of the constraints. These
variables added to the left hand side of the constraints are called slack variables.

So the constraints become.

As the slack variables are appears in the constraints those should be include in the
objective function by multiply those with zero, so that there is no change in the value
of objective function.

𝑀𝑎𝑥 𝑍=2 𝑥 1+5 𝑥 2 +0 𝑠1 +0 𝑠 2+0 𝑠3


Now find out the Initial Basic Feasible Solution (IBFS). To find out the IBFS take the
minimum values for the decision variables (x1, x2). From the data given in the problem
one can understand that minimum values of decision variable are x 1 = 0, x2 = 0.

By substituting the values x1 = 0, x2 = 0 in the following equations to get IBFS

IBFS is obtained as s1 = 24, s2 = 21, s3 = 9.


Substitute the values of all the variables in the objective function to get the
maximum value of Z corresponding to the IBFS

So as per IBFS Max Z = 0

Now we need to identify whether this solution is optimum (or) it can be improved.
To check it form the simplex table with the above available data
The available data is
Basic variables are s1, s2 and s3 and their values are 24, 21 and 9 respectively
Non basic variables are x1 and x2 and both are equal to zero. With this data
form the simplex table

cj 2 5 0 0 0 b θ

CB Basic x1 x2 s1 s2 s3
variables (BV)
0 𝑠1 1 4 1 0 0 24
0 𝑠2 3 1 0 1 0 21
𝑠3
0 1 1 0 0 1 9

Write the coefficients of the variable in the row c j using objective function

Write the basic variables and corresponding coefficients in the column C B


Fill the first row (Row corresponding to ) using the coefficients in the first equation

Fill the second row (Row corresponding to using the coefficients in the second equation

Fill the third row (Row corresponding to using the coefficients in the third equation
Now to check whether the IBFS is optimum or not find
2 5 0 0 0
BV b θ
0 1 4
KE
1 0 0 24 24/4=6
KR←
0 3 1 0 1 0 21 21/1=21
0 1 1 0 0 1 9 9 /1=9

0×1+0×3+0×1=0 0×4+0×1+0×1=0 0×1+0×0+0×0=0 0×0+0×1+0×0=0 0×0+0×0+0×1=0


2 5𝐊𝐂 ↑ 0 0 0

There are two non negative values 2 and 5 in row. So IBFS is not optimum.

Now move towards optimal solution as per the following procedure.

Select the column having highest non negative value as key column (column
corresponding to ) and find out θ values for each row as
Select the row having least non negative value as key row (row corresponding to
Select the intersection of key column and key row as key element (Cell having 4)
Made the key element 1 by dividing the entire row with 4. During this step there is no
change in the remaining rows. So

cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1/4 4/4=1 1/4 0/4=0 0/4=0 24/4=6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9

cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1 0 0 6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9

Now made all other elements except key element of key column (x2 column) zero by performing
only the row operations. Now s1 in the BV is outgoing variable and x2 becomes incoming
variable. In this step replace s1 with x2 and corresponding coefficient 0 with 5 in CB column.
There is no change in the other values of key row. The row operations to be performed are
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1 0 0 6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9

Perform the row operations

cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6

0 s2 1 11 1 1
3− = 1 - 1= 0 0− =− 1–0=1 0–0=0 21 – 6 = 15
4 4 4 4
0 s3 1 3 1 1
1− = 1 - 1= 0 0− =− 0–0=0 1–0=1 9–6=3
4 4 4 4

This solution is the second basic feasible solution. Again find out to identify
whether the second basic feasible solution is optimum or not
cj 2 5 0 0 0 b θ=
b/KC
CB Basic x1 x2 s1 s2 s3
variables
6
5 x2 1 0 0 6 =24
0 s2 1/4
15 60
=
11/ 4 11
0 s3
3
=4
KE 3/ 4KR

1 −1 −1 5
5x1+0
X0+0 5 × +0 × +0 × = 5X0+0
X1+0X
5X0+0
X0+0X
5X6+0
X15+0
X0=5
4 4 44 0=0 1=0 X3=30

5 3 5–5=0 5 5
2− = 0 − =− 0 – 0 = 0 0–0=0
4 4 4 4
KC↑

Still there is one positive value in row (corresponding to x 1 ). So select the first
column having highest non negative value as key column and find the θ values
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3

Now by performing row operation to made the key element as 1

cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3

4 3 4 4 −1 −1 4 4
× =𝟏 × 0= 0 × = 4 × 0= 0 × 1= 3 × 4 = 4
3 4 3 3 4 33 3 3 3
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3 1 0 0 4

Now perform the row operations to made other elements except key element of key
column zero. The row operations to be performed are Replace s 3 with x1 in BV column

cj 2 5 0 0 0 b
CB BV x1 x2 s1 s2 s3
1 1 1 1 1 1
5 x2 − × 1= 0 1 + × = =0 =
6−
1
4=5
4 4 4 4 3 3 4
0 s2
11 11 0 11
− ×1=0 −1 11 1 2 =
15 − 4=
4 4 + × = =1
4
4 4 3 3
2 x1 1 0 0 4
The solution in the above table x2 = 5 and x1 = 4 is the third basic feasible solution.
Now check whether this solution is optimum or not by finding

cj 2 5 0 0 0 b
CB BV x1 x2 s1 s2 s3
5 x2 0 1 0 5

0 s2 0 0 1 4

2 x1 1 0 0 4

1 2 −1
5×0+0×0+2×1=2
5×1+0×0+2×0=55× +0× +2× =1 5 × 5 + 0 × 4 + 2 × 4 =3
0 1

3 3 3
2-2=0 5-5=0 0-1=-1 0-0=0 0-1=-1

Now all the values in the row are non positive, so the solution x 2 = 5 and x1 = 4 is the
optimum solution.

So the optimum solution is x2 = 5 and x1 = 4 and the maximum value of Z is 33.


Simplex method

Subjected to

Solution
Convert the problem into standard form
Convert all the in equations into equations by adding slack
variables as all the constraints are less than or equal to type.

Then the objective function becomes


Now find the Initial Basic Feasible Solution (IBFS) by taking
the minimum values for all decision variables .

So take . Substitute the values in the following equations.

Then we will get , , .

These three variables are called as basic variables. Now using


the above data form the simplex table
cj 4 3 6 0 0 0 b θ

CB Basic x1 x2 x3 s1 s2 s3
variables (BV)
0 𝑠1 2 3 2 1 0 0 440
0 𝑠2 4 0 3 0 1 0 470
0 𝑠3 2 5 0 0 0 1 430

Write the coefficients of the variable in the row cj using the objective function

Write the basic variables and corresponding coefficients in the columns BV


and CB
Fill the first row (Row corresponding to ) using the coefficients in the first
equation

Fill the second row (Row corresponding to using the coefficients in the second
equation

Fill the third row (Row corresponding to using the coefficients in the third
equation
Now to check whether the IBFS is optimum or not find

cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
0 s1 2 3 2 1 0 0 440 220
0 s2 4 0 3 KE 0 1 0 470 470/3
KR←

0 s3 2 5 0 0 0 1 430
0*2+0* 0*3+0* 0*2+0* 0*1+0* 0*0+0* 0*0+0*
4+0*2= 0+0*5= 3+0*0= 0+0*0= 1+0*0= 0+0*1=
0 0 0 0 0 0
4-0=4 3-0=3 6-0=6 0-0=0 0-0=0 0-0=0
𝐊𝐂 ↑
There are three non negative values in row. So IBFS is not optimum.

To move towards optimum solution select the column having highest non
negative value as key column and find out θ values for each row as

Select the row having least non negative value as key row (row corresponding
to . Select the intersection of key column and key row as key element (Cell
having 4)
Made the key element 1 by dividing the entire row with 3. During this step
there is no change in the remaining rows. So

cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 2 3 2 1 0 0 440
4/3 0/3=0 3/3=1 0/3=0 1/3 0/3=0 470/3
0 s2
0 s3 2 5 0 0 0 1 430
0 0 0 0 0 0
4 3 6 0 0 0

cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 2 3 2 1 0 0 440
0 s2 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
Now made all other elements except key element of key column zero. Now s 2
in the BV is outgoing variable and x3 becomes incoming variable. So replace
s2 with x3 and corresponding coefficient 0 with 6 in CB column.
There is no change in the values of key row. The row operations to be
performed is there is no need to operate because already the corresponding
element is Zero

cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
0 s1 2-2*4/3 3-2*0 2 - 2*1 1-2*0 0 – 2*1/3 0 – 2*0
= - 2/3 =3 =0 =1 = - 2/3 =0
6 x3 4/3 0 1 0 1/3 0 470/3

0 s3 2 5 0 0 0 1 430
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
380/9
0 s1 - 2/3 3 KE 0 1 - 2/3 0 380/ KR←
3 ∞
6 4/3 0 1 0 1/3 0 470/ 86
x3
8 0 6 0 2 0 3
0 s3 2 5 0 0 0 1 430
-4 3 0 0 -2 0
𝐊𝐂 ↑
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 - 2/3 3 0 1 - 2/3 0 380/3
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430

Made the key element unity by dividing entire key row with key element

cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 -2/9 1 0 1/3 -2/9 0 380/9
s1
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430

Perform the row operation to made other elements of key row zero.
need not be operated because the corresponding cell already contains
zero. During this step should be replaced with and the corresponding
coefficients also should be replaced
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430

Row operation to be performed is

cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
3 x2 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3

()
0 s3

()
1 5 2 10 380 1970
2 28 5– 0 – 5*0 1-
2−5∗ − = 5*1 =0
0−5∗ =− 0−5 − = 5*0
430−5∗ =
9 9 =0 =1
9 9
3 3 9 9
Again perform the optimality test to check whether this solution is optimum or
not
Again find out

cj 4 3 6 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
3 x2 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 28/9 0 0 -5/3 10/9 1 1970/9

2 4 28 𝟐𝟐 3*1+ 1 5
𝑍 𝑗 =∑
3*0+

𝐶 𝐵 𝑥 𝑖𝑗− 9 ∗3+ 3 ∗6+ 9 ∗0= 𝟑 0*0=


6*0+ 6*1+
∗3+6∗0− ∗0=1 3*0+
6*0+
3
0*0=
6 3 3 0*1=
0

𝑐 𝑗− 𝑍 𝑗 - 10/3 0 0 -1 - 4/3 0

All the values in the row are non positive, So the above solution is
optimum

So , , and = = 0

3200
𝑍 𝑚𝑎𝑥 =
3
Subjected to

Solution
Convert the problem into standard form
Convert all the in equations into equations by adding slack
variables as all the constraints are less than or equal to type.

Then the objective function becomes


Now find the Initial Basic Feasible Solution (IBFS) by taking
the minimum values for all decision variables .

So take . Substitute the values in the following equations.

Then we will get 12, 8, .

These three variables are called as basic variables. Now using


the above data form the simplex table
The available data is
Basic variables are s1, s2 and s3 and their values are 12, 8 and 8 respectively
Non basic variables are x1 and x2 and both are equal to zero. With this data
form the simplex table

cj 2 1 0 0 0 b θ

CB Basic x1 x2 s1 s2 s3
variables (BV)
0 𝑠1 4 3 1 0 0 12
0 𝑠2 4 1 0 1 0 8
𝑠3
0 4 -1 0 0 1 8

Write the coefficients of the variable in the row c j


Write the basic variables and corresponding coefficients in the column C B
Fill the first row (Row corresponding to ) using the coefficients in the first equation 4

Fill the second row (Row corresponding to using the coefficients in the second equation

Fill the third row (Row corresponding to using the coefficients in the third equation
Now to check whether the IBFS is optimum or not find
2 1 0 0 0
BV b θ
0 4 3 1 0 0 12 12/ 4=3
0 4 1 0 1 0 8 8 /4=2
0 4 KE -1 0 0 1 8 8 /4=2

0×4+0×4+0×4=0 0×3+0×1+0×(−1)=0 0×1+0×0+0×0=0 0×0+0×1+0×0=0 0×0+0×0+0×1=0


KR←

2𝐊𝐂 ↑ 1 0 0 0

There are two non negative values 2 and 1 in row. So IBFS is not optimum.

Now move towards optimal solution as per the following procedure.


Select the column having highest non negative value as key column and find out θ
values for each row as
Select the row having least non negative value as key row. Here there are two equal θ
values. In such cases select the bottom most row of the two rows got tie as key
row. If the tie occurs between two columns select the left most column as key
column
Made the key element 1 by dividing the entire third row with 4. During this
step there is no change in the remaining rows. So

cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
4/4=1 -1/4 0/4=0 0/4=0 1/4 8/4=2
0 s3

cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
0 s3 1 - 1/4 0 0 1/4 2

Made other elements of key element of key column zero by performing the
following row operations. Now s3 in the BV is outgoing variable and x1 is
incoming variable. So replace s3 with x1 and corresponding values of CB. The
row operations to be performed are
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
0 s3 1 - 1/4 0 0 1/4 2

𝑅1 =𝑅1 − 4 𝑅3 𝑎𝑛𝑑 𝑅 2=𝑅 2 − 4 𝑅3


cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables

( )
1
0 s1
1- 4*0 0 - 4*0 -1 12 -
4 – 4*1=0 3−4 − = 4 =1 =0 4*2 = 4
4

1−4 ( − )=2
0 s2
4 – 4*1=0 1 0 - 4*0 1 - 4*0
-1
8 - 4*2
4 =0 =1 =0
2 x1 1 - 1/4 0 0 1/4 2
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 2 0 1 -1 0
2 x1 1 - 1/4 0 0 1/4 2

Again check whether this solution is optimum or not by conducting


optimality test
cj 2 1 0 0 0 b θ
CB BV x1 x2 s1 s2 s3
0 s1 0 4 1 0 -1 4 4/4=1
0 s2 0 2 KE 0 1 -1 0 0/2=0
KR ←
2 x1 1 - 1/4 0 0 1/4 2 2/(-1/4)=
-8

0*4+0*2 0*(-1)
0*0+0*0 0*1+0*0 0*0+0*1 +0*(-1)
+2*1= 2 -2*1/4=
-1/2 +2*0= 0 +2*0= 0 +2*1/4=
1/2
0 3/2 0 0 -1/2
KC↑
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 2 0 1 -1 0
2 x1 1 - 1/4 0 0 1/4 2

Made the key element unity by performing the row operation

cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0/2=0 2/2=1 0/2=0 1/2 - 1/2 0/2=0
2 x1 1 - 1/4 0 0 1/4 2

Now made all other elements of the key column zero by performing the row
operation and
Replace s2 with x2
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 1 0 1/2 - 1/2 0
2 x1 1 - 1/4 0 0 1/4 2

and

cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables KR ←
0 s1 0 0 1 -2 1 KE 4 4/1=4
1 x2 0 1 0 1/2 - 1/2 0 0/(-0.5)=
- ve
2 x1 2/(1/8)
1 0 0 1/8 1/8 2 = 16
2 1 0 3/4 -1/4

0 0 0 -3/4 1/4
KC↑
Made the key element unity. But the key element is already 1. So made the
other elements of key column zero . Replace s1 with s3

cj 2 1 0 0 0 b θ
CB BV x1 x2 s1 s2 s3
0 s3 0 0 1 -2 1 4
1 x2 0 1 0 1/2 - 1/2 0
2 x1 1 0 0 1/8 1/8 2
Row operations should be performed are and

cj 2 1 0 0 0 b θ
CB BV x1 x2 s1 s2 s3
0 s3 0 0 1 -2 1 4
1 x2 0 1 1/2 -1/2 0 2
2 x1 1 0 -1/8 3/8 0 3/2

2 1 1/4 1/4 0

0 0 -1/4 -1/4 0

All the values in the row are non positive, so


And
Solve the following LPP by simplex
method

Subjected to

Solution
In the second constraint the right hand side is negative, so first of all
convert it to positive by multiplying both sides of the constraint with –
1. Then the constraints becomes
Problem is minimization type, so change the problem into
maximization type by multiplying the objective function with – 1. So
the problem becomes

Subjected to

Now write the problem into standard form


Now find out the initial basic feasible solution by taking all the
decision variables as zero. . Substitute these values in the above
equations to get the initial basic feasible solution (IBFS). We will get

𝑠1=7 , 𝑠 2=12 , 𝑠 3=10

So the variables are basic variables as these are having values. With
this data form the simplex table.

cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4 3 8 0 0 1 10

Now check whether the IBFS is optimum or not


cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
-7
0 s1 3 -1 2 1 0 0 7
-3
0 s2 -2 -4 KE 0 0 1 0 12 10/3
0 s3 -4 3 8 0 0 1 10 KR←
0 0 0 0 0 0

-1 3 KC↑ -3 0 0 0

Made the key element unity by performing row operation

cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4/3 1 8/3 0 0 1/3 10/3
Made all other elements of key column zero by performing row operations
and
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4/3 1 8/3 0 0 1/3 10/3
and

cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 5/3 KE 0 14/3 1 0 1/3 31/3 31/5 KR←
s1
-22/3 0 32/3 0 1 4/3 76/3 - 38/11
0 s2
-5/2
3 x2 -4/3 1 8/3 0 0 1/3 10/
-4 3 8 0 0 1
3
3 0 -11 0 0 -1
KC↑

Still there is a positive value in the last row. So this solution is not optimum.
So again go for the selection of key element and continue the procedure.
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 5/3 0 14/3 1 0 1/3 31/3
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3
Made key element unity by performing row operation

cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
1 0 14/5 3/5 0 1/5 31/5
0 s1
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3

Made other two elements of the key column zero by performing row operation
and In this step replace with
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 1 0 14/5 3/5 0 1/5 31/5
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3
and

cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
-1 x1 1 0 14/5 3/5 0 1/5 31/5
0 0 156/5 22/5 1 14/5 354/5
0 s2
0 1 32/5 4/5 0 3/5 58/5
3 x2

Now check whether this solution is optimum or not by conducting


optimality test
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
-1 x1 1 0 14/5 3/5 0 1/5 31/5
0 s2 0 0 156/5 22/5 1 14/5 354/5
3 x2 0 1 32/5 4/5 0 3/5 58/5
-1 3 82/5 7/5 0 8/5

0 0 -97/5 -7/5 0 -8/5

All values are non positive, so this solution is optimum

. And

Now
Subjected to

Write the constraints in standard form

Find the initial basic feasible solution


If , and
Form the simplex table now

cj 2 3 4 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2
0 s1 3 1 4 1 0 600
0 s2 2 4 2 0 - 1 - 480
2 3 3 0 0 540
Here the problem is there are three constraints, but there are having only
two basic variables.

Another thing is while forming the first simplex table there must be one
identity (Unit) matrix. But here in the simplex table there is no identity
matrix.

To avoid these problem one has to introduce artificial variables. In artificial


variables techniques artificial variables must be added to the constraints of
greater than or equal type and equal to type.

There are two methods to solve the problems having artificial variables (i) Big
– M method, (ii) Two Phase simplex method.
Big – M method

Introduce the artificial variables in the above constraints where the


constraints are ≥ type and = type. Then the constraints becomes

Now the artificial variables appears in the constraints must be


appears in the objective function. In case of Big – M method add the
artificial variable to the objective function by multiplying the
artificial variables with a large negative number – M.

So the objective function becomes


𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑍 =2 𝑥1 +3 𝑥 2 + 4 𝑥3 + 0 𝑠 1 ++0 𝑠 2 − 𝑀 𝐴1 − 𝑀 𝐴2
Note:
 If the constraint is ≤ type there are decision variables and
slack variables.

 If the constraint is ≥ type there are decision variables and


surplus variables and artificial variables.
 If the constraint is = type there are decision variables and
artificial variables.

Now find out the IBFS.

To find the IBFS take the decision variables and surplus variables as
zero.

So . Then , , .

Now basic variables are . With this data form the simplex table.
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 𝑠1 3 1 4 1 0 0 0 600
-M 𝐴1 2 4 2 0 -1 1 0 480
-M 𝐴2 2 3 3 0 0 0 1 540

Take the first equation / constraint and using the coefficients of variables fill
the first row of the matrix

Take the second equation / constraint and using the coefficients of variables
fill the second row of the matrix

Take the third equation / constraint and using the coefficients of variables
fill the third row of the matrix

From the table one can say that 𝑠1=600 𝐴 1=600 𝐴 2=600

Now check whether this solution is optimum or not

To check this conduct the optimality test by finding out


cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600 600/1=600
480/4=120
-M A1 2 4 KE 2 0 -1 1 0 480
540/3=180
-M A2 2 3 3 0 0 0 1 540
0*2 – 0*1 – 0*4 – 0*1 – 0*0 – 0*0 –0*0 –
M*2 – M*4 – M*2 – M*0 – M*-1 M*1 -M*0 -
M*2= M*3= M*3= M*0= -M*0 M*0 =M*1 = KR
- 4M - 7M - 5M 0 =M -M -M
2-(- 3-(- 4-(- 0–M -M– -M–
0–0
4M) = 7M) = 5M) = =-M (-M) (-M)
=0 =0
2+4M 3+7M 4+5M =0
KC↑
There are 3 positive values, so this solution is not optimum.

Select the key column having highest positive value. So the column
corresponding to is the key column

Find out θ values by dividing column b with key column

Second row is having θ value 120 (min). So second row becomes key row and
the value 4 in the cell X is the key is the key element 1
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 2 4 2 0 -1 1 0 480
-M A2 2 3 3 0 0 0 1 540
Now made the key element unity by performing row operation

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1
600 0 0 0
2 1 4 2 1 0 − 1 1 0 =0 120
-M A1 = =1 = =0 4
4 2 4 4 2 4 4 4
-M A2 2 3 3 0 0 0 1 540

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3 3 0 0 0 1 540
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3 3 0 0 0 1 540
Make all other elements in the key column zero. The row operations to be
performed are ,

Replace with

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1𝟑 − 𝟏 = 𝟓 1-1=0 4 1-0=1 𝟎 −(−
𝟏 𝟏 𝟏 −𝟏 0-
)= 𝟎 − =
600-
𝟐 𝟐 𝟒 𝟒 𝟒 𝟒 0=0 120=
480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3-3*1
0-3*0 𝟏 𝟑 1-3*0 540-
=0
=0 𝟎−𝟑(− )= =1 3*120
𝟒 𝟒 =180
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/2 0 3/2 0 3/4 -3/4 1 180
Now check whether this solution is optimum or not

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480 960/7

1/2 1 1/2 0 -1/4 1/4 0 120 240


3 x2
KE 120
-M A2 1/2 0 3/2 0 3/4 -3/4 1 180 KR←
3−𝑀 3 3 −3 𝑀 0 −3−3 𝑀 3 𝑀+ 3 -M
2 2 4 4
1+ 𝑀
0 5+3 𝑀 3+3 𝑀 −7 𝑀 − 3 0
2 0
2 4 4
KC↑
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/2 0 3/2 0 3/4 -3/4 1 180
Make the key element unity by operate the row 3 as

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1 1/2
2 1 1
23 1/2
2 0∗ 0 2 𝟏 −3 1/4
2 3 -1/4 2 −𝟏 0
2 2
120
∗ = 0 ∗ =0 ∗ =1 =0∗ =
-M A2 2 3 3 3 2 3 3 4 3 𝟐 ∗ = 1 ∗ 3 = 3 120
4 3 𝟐
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/3 0 1 0 1/2 -1/2 2/3 120
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/3 0 1 0 1/2 -1/2 2/3 120
Make the other two elements of key column zero
Row operations to be performed are

cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
4/3 0 0 1 -3/2 3/2 -7/3 60
0 s1
1/3 1 0 0 -1/2 1/2 -1/3 60
3 x2
4 x3 1/3 0 1 0 1/2 -1/2 2/3 120

Now check whether this solution is optimum or not

For that go for the optimality test by calculating and


cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 4/3 0 0 1 -3/2 3/2 -7/3 60
3 x2 1/3 1 0 0 -1/2 1/2 -1/3 60
4 x3 1/3 0 1 0 1/2 -1/2 2/3 120

𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 𝑖𝑗 7/3 3 4 0 1/2 -1/2 5/3

𝑐 𝑗− 𝑍 𝑗 -1/3 0 0 0 -1/2
−2 𝑀 + 1−3 𝑀 − 5
2 3

Here all the values are non positive as “– M” is very large negative number.
So the above solution is optimum

The optimum solution is , ,

Hence
Two Phase Simplex Method

Subjected to

Convert the problem into standard form


In case of two phase simplex
method artificial variables
must be multiplied with – 1
and add to the objective
function
Find out the IBFS by taking all decision variables and surplus variables as
Zero.
29
If 𝑠1= 7 , 𝑠 2=2 , 𝐴 1=
7
Now form the simplex table using the above IBFS and the following equations

In the first phase of the two phase simplex method take the values of all the
variables as zero except artificial variables. For artificial variable take as – 1

cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5 7 4 1 0 0 0 7
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
Now check whether the above solution is optimum or not by conducting optimality test
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5 7KE 4 1 0 0 0 7 7/7=1
-2/7
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7 29/28

𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 0*3+0*
𝑖𝑗 4 - 1*3
0*7+0* 0*4+0* 0*1+0* 0*0+0* 0*0+0*
-7 -1*4 5 -1*-6 0 -1*0 1-1*0 0 -1*-1
0*0+0*
0 -1*1
=-3 =-4 =6 =0 =1 = -1 KR←
=0

𝑐 𝑗− 𝑍 𝑗 3 4 -6 0 0 -1 0
KC↑
Now make the key element 1 by operate the 1st row as

cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
5/7 7/7=1 4/7 1/7 0/7=0 0/7=0 0/7=0 7/7=1
0 s1
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5/7 1 4/7 1/7 0 0 0 1
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
Now make all other elements of key column zero. For that the row operations
to be performed are and

Now replace with

cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
9 0 -1 1 1 0 0 9
0 s2
1/7 0 -58/7 -4/7 0 -1 1 1/7
-1 A1

Check whether this solution is optimum or not


cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1 7/5
0 9 0 -1 1 1 0 0 9 1
s2
KE 1
-1 A1 1/7 0 -58/7 -4/7 0 -1 1 1/7
𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 𝑖𝑗
KR←
-1/7 0 58/7 4/7 0 1 -1

𝑐 𝑗− 𝑍 𝑗 1/7 0 -58/7 - 4/7 0 -1 1


KC↑
Now make the key element 1 by row operation

cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
0 s2 9 0 -1 1 1 0 0 9
1 0 -58 -4 0 -7 7 1
-1 A1
Make all other elements of key column zero by row operations and
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
0 s2 9 0 -1 1 1 0 0 9
-1 A1 1 0 -58 -4 0 -7 7 1
and Replace with

cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 0 1 42 3 0 5 -5 2/7
x2
0 0 521 37 1 63 -63 0
0 s2
0 x1 1 0 -58 -4 0 -7 7 1

Now all the artificial variables are eliminated from BV column. So this is the
end of the first phase

In the second phase take this final simplex table of the first phase by
excluding artificial variables columns and original values of
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
0 s2 0 0 521 37 1 63 0
3 x1 1 0 -58 -4 0 -7 1
Now check whether this solution is optimum or not by conducting optimality
test

cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 0 1 42 3 0 5 2/7 1/147
x2
KE 0 KR←
0 s2 0 0 521 37 1 63 0
- 1/58
3 x1 1 0 -58 -4 0 -7 1
3 2 - 90 -6 0 - 11

0 0 92 6 0 11
KC↑

Make the key element 1 by row operation


cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
0 s2 0 0 521 37 1 63 0
3 x1 1 0 -58 -4 0 -7 1
𝑅 2=𝑅 2 /521

cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
0 0 0 1 37/521 1/521 63/521 0
s2
3 x1 1 0 -58 -4 0 -7 1

Make all other elements of key column zero by roe operations


and

Replace with
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
2 x3 0 0 1 37/521 1/521 63/521 0
3 x1 1 0 -58 -4 0 -7 1

and

cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 0 1 0 9/521 -42/521 -41/521 2/7
x2
2 x3 0 0 1 37/521 1/521 63/521 0
1 0 0 62/521 58/521 7/521 1
3 x1

Now check whether this solution is optimum or not by conducting


optimality test
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 0 9/521 - 42/521 - 2/7
41/521
2 x3 0 0 1 37/521 1/521 63/521 0
3 x1 1
3 0
2 0
2 62/521
278/521 58/521 7/521 1
92/521 65/521

0 0 0 -278/521 -92/521 -65/521

All the values in the row are non positive. So this solution is optimum

The solution is

2 25
𝑍 𝑚𝑎𝑥 =3 ∗1+ 2∗ + 2∗ 0=
7 7
Subjected to

Write the problem in standard form

Find out Initial Basic Feasible Solution by taking the values of all decision
and surplus variables as zero.
𝑥1 =𝑥2 =𝑠 1=𝑠 3=0
Then IBFS is obtained as , ,
Now form the simplex table using the following equations

4 5 0 0 0 -M -M b θ
BV
-M 1 1 -1 0 0 1 0 1
0 -2 1 0 1 0 0 0 1
-M 4 -1 0 0 -1 0 1 1

Check whether this solution is optimum or not


4 5 0 0 0 -M -M b θ
BV
-M 1 1 -1 0 0 1 0 1 1
0 -2 1 0 1 0 0 0 1 -1/2
-M 4KE -1 0 0 -1 0 1 1 1/4
KR←
-5M 0 M 0 M -M -M
4+5M 5 -M 0 -M 0 0
KC↑

Make the key element 1 by dividing the row 3 with 4.


4 5 0 0 0 -M -M b θ
BV
-M 1 1 -1 0 0 1 0 1
0 -2 1 0 1 0 0 0 1
-M 1 -1/4 0 0 -1/4 0 1/4 1/4

by row operations and

4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 - 1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4
4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 -1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4

Now check whether the solution is optimum or not

4 5 0 0 0 -M -M b θ
BV
KR
-M 0 5/4KE -1 0 1/4 1 -1/4 3/4 3/5
0 0 1/2 0 1 -1/2 0 1/2 3/2 -1
1 -1/4 0 0 -1/4 0 1/4 1/4 -1
−5 𝑀 − 4 − 𝑀 − 4 -M 𝑀+4
-M 0
4 4 4 4
5 𝑀+24 𝑀+4 −5 𝑀 − 4
0 M 0 0
4 4 4
KC
4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 -1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4

Make the key element 1 by row operation by

4 5 0 0 0 -M -M b θ
BV
-M 0 1 -4/5 0 1/5 4/5 -1/5 3/5
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4

Make other two elements of key column zero by row operations


and
4 5 0 0 0 -M -M b θ
BV
-M 0 1 -4/5 0 1/5 4/5 -1/5 3/5
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4

and

4 5 0 0 0 -M -M b θ
BV
5 0 1 -4/5 0 1/5 4/5 -1/5 3/5
0 0 0 -2/5 1 -2/5 2/5 2/5 4/5
1 0 -1/5 0 -1/5 1/5 1/5 2/5

Check whether this solution is optimum or not


4 5 0 0 0 -M -M b θ
BV
5 0 1 -4/5 0 1/5 4/5 -1/5 3/5 -3/4
0 0 0 -2/5 1 -2/5 2/5 2/5 4/5 -1/2
1 0 -1/5 0 -1/5 1/5 1/5 2/5 -1/2

4 5 -24/5 0 1/5 24/5 -1/5

−5 𝑀 − 24 −5 𝑀 − 1
0 0 24/5 0 -1/5 5
5
KC

Now all the values in the minimum ratio column (θ) are negative. So
we can not select the key row. So the solution is unbounded
Subjected to

Write the problem in standard form

Find out Initial Basic Feasible Solution by taking the values of all decision
and surplus variables as zero.
𝑥1 =𝑥2 =𝑠 2=0
Then IBFS is obtained as 8,
Now form the simplex table using the following equations

2 3 0 0 0 -M b θ
BV

0 1 -3 1 0 0 0 6
-M 2 4 0 -1 0 1 8
0 -1 3 0 0 1 0 6
Check whether this solution is optimum or not
2 3 0 0 0 -M b θ
BV
0 1 -3 1 0 0 0 6 -2
-M 2 4 0 -1 0 1 8 2
0 -1 3 KE 0 0 1 0 6 2 KR

-2M -4M 0 M 0 -M

2+2M 3+4M 0 -M 0 0
KC
Make the key element 1 by dividing the row 3 with 3.
2 3 0 0 0 -M b θ
BV
0 1 -3 1 0 0 0 6
-M 2 4 0 -1 0 1 8
0 -1/3 1 0 0 1/3 0 2

by row operations and

2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 10/3 0 0 1 -4/3 1 0
-1/3 1 0 0 1/3 0 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 10/3 0 0 1 -4/3 1 0
-1/3 1 0 0 1/3 0 2

Now check whether the solution is optimum or not


2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12 ∞
-M 10/3 0 0 1 -4/3 1 0 0
-1/3 1 0 0 1/3 0 2 -2/3
−10 𝑀 − 3 3 0 -M
4 𝑀 +3 -M
3 3
10 𝑀 + 3 0 0 M −4 𝑀−3 0
3 3
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 10/3 0 0 1 -4/3 1 0
-1/3 1 0 0 1/3 0 2

Make the key element 1 by row operation by

2 3 0 0 0 -M b θ
BV

0 0 0 1 0 1 0 12
-M 1 0 0 3/10 -2/5 3/10 0
-1/3elements
Make other two 1 of0 key column
0 1/3 0 row operations
zero by 2
2 3 0 0 0 -M b θ
BV

0 0 0 1 0 1 0 12
-M 1 0 0 3/10 -2/5 3/10 0
-1/3 1 0 0 1/3 0 2

2 3 0 0 0 -M b θ
BV

0 0 0 1 0 1 0 12
2 1 0 0 3/10 -2/5 3/10 0
0 1 0 1/10 1/5 1/10 2
Check whether this solution is optimum or not
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
2 1 0 0 3/10 -2/5 3/10 0
0 1 0 1/10 1/5 1/10 2
2 3 0 9/10 -1/5 9/10
0 0 0 -9/10 1/5 -M-
9/10

Now all the values in the minimum ratio column (θ) are negative. So
we can not select the key row. So the solution is unbounded
Subjected to

Write the problem in standard form

Find out the IBFS by taking decision variables and surplus


variables as zero

Then IBFS is and


Now form the simplex table using the following equations

5 3 0 0 -M b θ
BV
0 2 1 1 0 0 1
-M 1 4 0 -1 1 6

Conduct the optimality test to check whether the solution is


optimum or not
5 3 0 0 -M b θ
BV
0 2 1 KE 1 0 0 1 1 KR
-M 1 4 0 -1 1 6 3/2
-M -4M 0 M -M

5+M 3+4M 0 -M 0
KC
Key element is already zero. So make all other elements of the
key column zero. The operation to be performed is

5 3 0 0 -M b θ
BV
3 2 1 1 0 0 1
-M -7 0 -4 -1 1 2
Check for optimality of the above solution

5 3 0 0 -M b θ
BV
3 2 1 1 0 0 1
-M -7 0 -4 -1 1 2

7M+6 3 4M+3 M -M

-7M-1 0 -4M-3 -M 0

Here all the values in are non positive , but still the artificial
variables are not eliminated from the simplex table. So the
solution is infeasible
Disadvantages of Simplex Method

 Depending on the starting guess for the parameters the


simplex procedure can give a local minima or maxima,
rather than global optimum.

 Some times the procedure never converge to an answer.

 The procedure cannot be parallelized to use distributed


computing resources to speed up the computation time.

 No good post-hoc to all the computation to include


constraints on the model parameters in the analysis. One
has to include the constraints right from the beginning.
Disadvantages of Big M Method

 How large should be the M value is not known

 It is computationally inconvenient due to the existance of


the large number M

 It is difficult solve the problem in digital computers because


a specific value must be assigned to M in computers which
is not known

 It is inferior than 2 phase simplex method

 Feasibility is not known until post optimality tests

 Never used in commercial codes


Duality in Linear Programming

For every linear programming problem there is another LP


problem involving the same data which also describe the
original problem.

The given problem is called primal problem.

This can be rewritten by transposing the rows and columns of


the algebraic statement of the problem.

This re written problem is called dual problem.


Need for dual

 If the primal has large number of rows and smaller number


of columns the computational procedure can be reduced by
converting the primal into dual.

 It gives the information of how the optimal solution changes


with the change in coefficients.

 It can help managers answer questions about alternative


courses of action and their relative values.

 Calculation of the dual checks the accuracy of the primal.

 Economic interpretations of the dual help the management


in making the future decisions.
Rules for converting the primal into dual

If the primal contains n variables and m constraints, dual contains


m variables and n constraints.

The maximization problem of the primal becomes the minimization of dual


and vice versa.

The maximization problem of primal must have all ≤ type constraints and the
minimization have all ≥ type constraints.

Constraints of ≤ in primal become ≥ type in dual and vice versa.

The constants , , ,..….. in the objective function of the primal appears in the
constraints of the dual.

The constants , , ,..….. in the constraints of the primal appears in the


objective function of the dual.

The variables in both the problems are non-negative.


Convert the following primal to dual

Subjected to

Duality
The primal is having 2 variables and 4 constraints, so the dual
will have 4 variables and 2 constraints.

Let the variables in the dual are y1, y2, y3 and y4

The objective function in the primal is maximization type, so


the objective function in the dual should be minimization type.
If the primal is of maximization type all the constraints must
be ≤ type. Otherwise convert those into ≤ type.

Here in the problem all the variables are less than or equal to
type. So there is no need of conversion.

Let the objective function in the dual is indicated by W

Variable in dual
Variable in dual

𝑀𝑖𝑛𝑖𝑚𝑖𝑧𝑒 𝑊 =50 𝑦 1 +35 𝑦 2 +10 𝑦 3 +20 𝑦 4


Subject to

2 𝑦 1 +3 𝑦 2 +5 𝑦 3 ≥ 3

6 𝑦 1 +2 𝑦 2 −3 𝑦 3 +𝑦 4 ≥5

𝑦 1, 𝑦 2, 𝑦 3, 𝑦 4 ≥ 0
Construct the dual of the problem

Subjected to

The primal is having 3 variables and 5 constraints, so the


dual will have 5 variables and 3 constraints.

Let the variables in the dual are y1, y2, y3, y4 and y5

The objective function in the primal is minimization type, so


the objective function in the dual should be maximization type.
If the primal is of minimization type all the constraints must
be ≥ type. Otherwise convert those into ≥ type.

So the constraints becomes


3 𝑥 1+5 𝑥 2 + 4 𝑥3 ≥ 7

6 𝑥 1+ 𝑥 2 +3 𝑥 3 ≥ 4
7 𝑥 1 −2 𝑥 2 − 𝑥 3 ≤10 −7 𝑥 1 +2 𝑥 2 + 𝑥 3 ≥ −10
𝑥1 −2 𝑥 2+5 𝑥 3 ≥ 3

4 𝑥1 +7 𝑥 2 − 2 𝑥 3 ≥ 2

𝑥1 , 𝑥2 , 𝑥 3 ≥ 0
Let the objective function in the dual is indicated by W

Variable in dual

𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑊 =7 𝑦 1+4 𝑦 2 −10 𝑦 3 +3 𝑦 4 +2 𝑦 5


Subjected to
3 𝑦 1+6 𝑦 2 −7 𝑦 3 + 𝑦 4 +4 𝑦 5 ≤3
5 𝑦 1+ 𝑦 2 +2 𝑦 3 − 2 𝑦 4 +7 𝑦 5 ≤ −2
4 𝑦 1 +3 𝑦 2 + 𝑦 3 +5 𝑦 4 −2 𝑦 5 ≤ 4
𝑦 1, 𝑦 2, 𝑦 3, 𝑦 4 , 𝑦5 ≥ 0

You might also like