You are on page 1of 78

Chapter 2:

Linear Programming & Simplex


method to Solve LP Problems
Graphical (Geometrical) Method Vs Simplex Method
• The GM is best used when we have two DVs in the problem. Whereas in SM
can be used for any number of DVs
• In GM, the inequalities are assumed to be equations, so as to enable to draw
straight lines. But in Sm, the inequalities are converted into equations by:
Adding a SLACK VARIABLE in ≤ type constraints and
subtracting a SURPLUS VARIABLE in ≥ type constraints.
Adding Artificial variable & subtracting Surplus variable in=type
constraints
• In GM, the areas outside the feasible area (area covered by all the lines of
constraints in the problem) indicates idle capacity of resource whereas in SM,
the presence of slack variable in the solution indicates the idle capacity of the
resources.
Cont.
• In economic terminology:
– slack variables represent unused capacity
– surplus variables represent excess amount
– Artificial variable has no any physical meaning
– the contribution associated with all of these variables to the
objective function is zero
Simplex method-defined
• is an iterative technique that begins with a feasible solution that
is not optimal, but serves as a starting point.
• Through algebraic manipulation, the solution is improved until no
further improvement is possible (i.e., until the optimal solution
has been identified).
• Each iteration moves one step closer to the optimal solution.
• Then the process of improving the feasible solution until we get
the optimal feasible solution is called iteration
Scope of solution of LPP by simplex method
• Following types of problems are solved by simplex method:
– Maximize Z with inequalities of constraints in “< “form.
– Maximize Z with inequalities of constraints in “>“form.
– Minimize Z with inequalities of constraints in “>“form.
 Maximize Z with inequalities of constraints in “< “,
“>“ or “=” form These are mixed
 Minimize Z with inequalities of constraints in “< “, constraints
“>“or “=”form. problems
Maximize Z with inequalities of
all constraints in “< “form.
• The simplex procedure for a maximization problem with all constraints 
types consists of the following basic steps:
 STEP-1- Write the LP model in a standard form (conversion of constraints
and the objective function).
 STEP-2- finding an initial feasible solution/IFS/
 Step 3 Develop the initial tableau
 Step 4 – develop subsequent tableaus
 Not Test optimality with each tableau
 Optimal value is obtained if all elements in Cj-Zj (indicator/net
evaluation) row ≤ 0 (i.e. all elements of Cj-Zj ≤ 0)
Example: Maximization (all constraints ≤ type)
• A factory manufactures two products A and B on three machines X, Y,
and Z. Product A requires 10 hours of machine X and 5 hours of machine
Y a one hour of machine Z. The requirement of product B is 6 hours, 10
hours and 2 hours of machine X, Y and Z respectively. The profit
contribution of products A and B are Birr 23 per unit and Birr 32 per unit
respectively. In the coming planning period the available capacity of
machines X, Y and Z are 2500 hours, 2000 hours and 500 hours
respectively. Find the optimal product mix for maximizing the profit.
• Required:
1. Formulate the LP model
2. Solve and determine the solution by simplex methods
Solution: Formulate the mathematical model
• Let the company manufactures a units of A and b units of B.
Then the inequalities of the constraints (machine capacities) are:
• Max. Z = 23a + 32b
St. 10a + 6b ≤ 2500 machine X time
5a + 10b ≤ 2000  machine Y time
1a + 2b ≤ 500  machine Z time
a & b≥0 non-negativity
1st Step - standardize the LP model.
• Standardization in all constraints  types is changing the
inequalities to equations using slake variables.
• That is standardization is used to introduce Slack Variables (in all
constraints  types).
– When all the constraints are written as equalities, the LPM is said
to be in a standard form.
• Slake is added in both
 objective function and
 each constraint.
Standardizing the constraints:
• Slack is used because the left hand side constraints is ≤ the RHSQ.
• So to equalize the LHSCs with RHSQ slack is added on LHS
• Example take machine X: the company manufacturing a units of A and b
units of B, hence both put together must be less than or equal to 2,500 hours.
– But decision variables a and b are unknown, thus we cannot exactly
know how much to add to convert the inequality into an equation.
– For this we represent the idle capacity by means of a SLACK
VARIABLE represented by letter s, q, r, etc.
– Usually we use letter S.
• Slack variable for first inequality is S 1, that of second one is S2 and
that of ‘nth” inequality is Sn.
Standardize the Problems…Cont’d
• Thus the standardized equations of machines X, Y and Z
are:
10a + 6b + 1S1+ 0S2 + 0S3 = 2,500  machine X time
5a + 10b + 0S1+ 1S2 + 0S3 = 2000  machine Y time
1a + 2b + 0S1+ 0S2 + 1S3 = 500  machine Z time
Standardizing the objective function (OF)
• The model’s OF is Z Max = 23a + 32b
• Every variable in the model must be represented in the objective
function, including slakes.
• If company does not manufacture A or B, all resources remain idle.
Hence the profit will be Zero Birr. This clearly shows that the profit
contribution of each hour of idle (slack) resource is zero.
• Since slacks don’t provide any real contribution to the objective,
each slack variable is assigned a coefficient of zero in the objective
function.
Standardize the Problems …Cont’d
• Note the following points:
• A slack variable is added to the left hand side of a < constraint to covert the
constraint inequality in to equality (equation).
• A slake variable emerges when the LPP is a maximization problem but not
always (.i.e, in case if the constraint is equality (=) type, no slack variable
even if the Z is to maximize).
• Slack variables represent unused resource or idle capacity. Thus, they
don’t produce any product and their contribution to profit is zero. That is
Slack variables are added to the objective function with zero coefficients.
• The slack variables (S1, S2 and S3) are idle resources. The profit earned by
keeping all the machines idle is Birr 0 per unit. Hence the profit
contributions of S1, S2 and S3 are Birr 0 per unit.
Standardize the Problems …Cont’d
• The Standard form of the LPM is:
Max Z = 23 a + 32 b + 0S1 + 0S2 + 0S3 s.t.
10 a + 6 b + 1S1 + 0S2 + 0S3 = 2500
5 a + 10 b + 0S1 + 1S2 + 0S3 = 2000
1 a + 2 b + 0S1 + 0S2 + 1S3 = 500 and
a, b, S1, S2 and S3 ≥ 0

This can be simply written as:


Maximize Z = 23 a + 32 b + 0S1 + 1S2 + 0S3 s.t.
10 a + 6 b + 1S1 = 2500
5 a + 10 b + 1S2 = 2000
1 a + 2 b + 1S3 = 500
a, b, S1, S2 and S3 ≥ 0
2nd Step - developing Initial Feasible Solution
• The search for the optimal solution in SM begins at the origin
• This assuming that nothing can be produced.
• No production implies that a = 0 and b = 0 (for this model )
• Thus at this case a & b are non-basic variables
– The non-basic variables are those variables that are not included in basic
variables (program variables) and not included in feasible solution
(i.e., those that have 0 values).
– All non-basic variables are eliminated from basics and their value
becomes zero.
Cont.

• Thus the initial feasible solution(IFS) entirely contains the slack


variables in maximization where all constraints are ≤ type.
• Here the IFS includes only S1 = 2500, S2= 500 and S3 = 2000.
• Now the basic variables include S1, S2 and S3.
• The basic variables are those that have values other than zero (0) value.
They are also called program variables.
3rd Step - develop the First Simplex Tableau

• List the variables across the top of the table and write the objective
function coefficient of each variable just below/above it.
• There should be one row in the body of the table for each constraint,
list the slack variables in the bases column, one per row.
• In the Cj (CB) column enter the objective function coefficient of zero for
each slack variable.
• Compute values for row Zj.
• Compute values for row Cj-Zj, where Cj is coefficient of variable j in the
objective function.
Cont.
3rd Step - develop the First Simplex Tableau
Programme Cj 23 32 0 0 0 Quantity Replacement Ratio
  (Basic) variables (CB) a b S1 S2 S3 in units  
2,500/6 = 416.7
  S1 0 10 6 1 0 0 2500  
  2000/10 = 200  
S2 0 5 10 0 1 0 2000
500/2 = 250
  S3 0 1 2 0 0 1 500  
 
  Z   0 0 0 0  0  0  

  Cj- Zj = net evaluation  


  23 32 0 0 0    

 Cj-Zj value is always 0 for BV/PV/


Identity matrix- indicating these  Cj-Zj value is always non-zero for non-BV
variables are BV (PV)
Interpretation of the 1st Simplex Table
 In case of maximization, the optimal solution is arrived when all Cj-Zi row
equal to 0 or negative for the for all variables, including slake variables.
 All basic variables (variables that are in the basic solution) have 0 values in
the Cj-Zj row. Hence, 3 Variables (S1, S2, and S3) are basic variables (in the 1st
simplex tableau)
 All non-basic variables (variables that are out of the solution, a & b) have
values different from zero in Z-C row elements.
 In the table the total profit is Z = 2500×0 + 2000 ×0 + 500 × 0 = Birr 0.00.
 The number in the Z row indicates the total (gross) profit of each variable.
STEP-4- Choosing the entering and leaving variables
• Determining the Entering variable:
• The entering variable is the variable that has the highest positive value in
the Cj - Zj row (also called indicator row).
• select the variable, which is having higher opportunity cost as the
incoming variable (or select the variable, which is having highest positive
number in the net evaluation row). Because it is the indication of highest
profit potential.
• Opportunity cost means for not including a particular profitable variable
in the programme, the manufacturer has to lose the amount equivalent to
the profit contribution of the variable.
– b in our case is the entering variable
– The column associated with the entering variable is called key or pivot
column ( b column in our case )
Cont.
• Determining the Outgoing variable:
• Divide the capacity column (quantity column) elements by key column
numbers to get replacement ratio column elements (RRCE)
• The row with the minimum or lowest positive (non-negative) replacement
ratio shows the variable to leave the solution.
• We have to select the positive (non-negative) lowest element because this is
the limiting ratio.
– The lowest positive value indicates no more resource in the associated constraint
– The negative value and undefined value of RR indicates no restriction on the resource
in that constraint
• The element at the intersection of pivot (key) column and pivot row is
known as key (pivot) number (No. 10 in our case).
• The row associated with the leaving variable is called key or pivot row (S2
column in our case).
Cont.
• In the problem S2 is the outgoing variable. This means that the entire
capacity of machine Y is utilized.
• Example take the coefficients (key column numbers) of of incoming viable
“b” and consider the idle resources in relation to lowest value of RR:
• Thus by manufacturing 200 units of ‘b’,
 6 × 200 = 1200 hours of machine X is consumed,
 10 x 200 = 2,000 hours of machine Y is consumed and
 2 × 200 = 400 hours of machine Z is consumed.
 2000 – 2000 = 0 hours of machine Y remained, no idle resource
 2500 –1200 = 1300 hours of machine X remains idle and
 500 – 400 = 100 units of machine Z remains idle.
Cont.
• For improved solution using the information obtained earlier, another tableau
is derived where in the various elements are obtained as given here.
a. Divide each element of the pivot row by the pivot element to get the
corresponding values in the new tableau.
 The pivot element become 1.
– The row of values so derived is called the replacement row.
 Old R2÷10 = new R2 = 0.5, 1, 0, 0.1, 0, 200
b.For each row other than the pivot row, perform row operations to
make all other entries for the pivot column equal to zero.
• The concept of elementary row operations to be performed.
Cont.
• perform row operations to make all other entries (other tan key
number) for the pivot column equal to zero using the Revised (new)
row.

R2÷10 NewR2 0.5 1 0 0.1 0 200


-6NewR2 -3 -6 0 -0.6 0 -1200
+ R1 10 6 1 0 0 2500
New R1 7 0 1 -0.6 0 1300
-2NewR2 -1 -2 0 -0.2 0 -400
+ R3 1 2 0 0 1 500
New R3 0 0 0 -0.2 1 100
2nd Table

 Programme (Basis Cj/CB/ 23 32 0 0 0 Quantity Replacement


variables) a b S1 S2 S3 in units Ratio.
S1 0 7 0 1 -0.6 0 1,300 1300/7 = 185.7
 b 32 0.5 1 0 0.1 0 200 400
  S3 0 0 0 0 -0.2 1 100 --
  Z   16 32 0 3.2 0 6,400   
 Cj- Zj = NE   7 0 0 -3.2 0    

Evaluate elements of Net evaluation row/indicator row/:


Column under a = 23 – (7 × 0 + 0.5 × 32 + 0 × 0) = 23 – 16 = 7
b = 32 – (0 × 0 + 1 × 32 + 0 × 0) = 32 – 32 = 0
S1 = 0 – (1 × 0 + 0 × 32 + 0 × 0) = 0
S2 = 0 – (– 0.6 × 0 + 0.1 × 32 + –0.2 × 0) = – 3.2
S3 = 0 – (0 × 0 + 0 × 32 + 1 × 0) = 0
Z = 32 × 200 = Birr. 6,400
The solution of the 4th tableau
S1 =1,300, S2 =0, S3= 100, a = 0, b =200
• The resulting Profit Z = 32 × 200 = Birr. 6400.
• But are these the optimal values and the profit is maximum profit?
• To answer this question see the indicator row - Cj-Zj row.
• If all Cj-Zj row values are zeros or negatives, you have reached optimality (
in max case).
– For maximization problem all elements of net evaluation row must be
either zeros or negative elements.
• Since there is positive number in the Cj-Zj row, the searches for optimal
solution will proceed. This demands the development of third tableau. The
third tableau is constructed by the same procedures used in table 2.
Step 5: Developing the 3rd tableau (selecting exiting & entry variable)

• Select the highest positive element in net evaluation row or highest


opportunity cost.
• The highest positive number is 7. That is “a” row is incoming.
• To decide the outgoing variable, find the replacement (substitution) ratios by
dividing the capacity column/quantity column/ element in the row by key
column elements of the same row and write the ratios in replacement ratio
column.
• Replacement ratios:
1300/7 = 185.7
200/0.5 = 400
100/0 = infinity
• Thus the incoming variable now is “a” and the outgoing basic variable is S1.
3rd Tableau
• Revise the key row (The point here is to make the pivot key (7) to 1.
1/7R =>1New R1 = 1 0 0.143 – 0.086 0 185.7
• Revise Non key rows: the rows to be revised are row 2 and row 3.
1/7R1 NewR1 1 0 0.143 -0.086 0 185.714
-0.5NewR1 -0.5 0 -0.071 0.043 0 -92.857
+ R2 0.5 1 0 0.1 0 200
New R2 0 1 -0.071 0.143 0 107.143
NewR3 0 0 0 -0.2 1 100

Row 3: As the fixed ratio is zero this row elements will not change. Fixed ratio means
the key element /pivot element (In other words the revision is required to make the
concerned key column number to zero (0). However, in this case the number is already
zero (0). Therefore, there is no need to revise the existing (old) row. We simply take
the old row for the next table.
The 3rd Tableau

BVs Profit/ C 23 32 0 0 0 Qty RR


unit a b S1 S2 S3
a 23 1 0 1 0.143 0 185.7 1300/7 = 185.7
b 32 0 1 – 0.07 0.143 0 107.14 400
S3 0 0 0 0 -0.2 1 100 --
Z   23 32 20.76 2.6 0  7,700  
C- Z =   0 0 -20.76 -2.6 0    

Net evaluation row elements (C-Z):


For ‘a’ = 23 – (1 × 23 + 0 × 32 + 0 × 0) = 0
For ‘b’ = 32 – (0 × 23 + 1 × 32 +0 × 0 )= 0
For S1 = 0 – (0.143 × 23 + (– 0.07 × 32) + 0 × 0) = –1
For S2 = 0 – (–0.086 × 23) + 0.143 × 32 + (– 0.02 × 0) = – 2.6
For S3 = 0 – (0 × 23 + 0 × 32 + 1 × 0) = 0
Profit Z = 185.7 × 23 + 107.14 × 32 = Birr. 7,700
Interpretation

• As all the elements of net evaluation row are either negative elements or
zeros, the solution is optimal.
• The solutions a = 185.7 and b = 107.15
• The answer is the company has to manufacture: 185.7 units of A and
107.14 units of B and the optimal return is Z = Birr. 7,700.
• At this level slake variables
S1 = 0
S2 = 0
S3 = 100
• SELF-CHECK
 solve graphically the above LP problem and cross-check the results
Example 2- Maximize with all constraints ≤ types
• A firm that assembles computer and computer equipment is about
to start production of two new microcomputers: Type I & Type II.
The manger has obtained the following information:
Type 1 Type 2 Available resources
Profit per unit Birr 60 Birr 50
Assembly time per unit 4hrs 10hrs 100hrs
Inspection time per unit 2hrs 1hr 22hrs
Storage space per unit 1 cubic ft 3cubic ft 39 cubic feet
•  Required: Formulate the LPM & the optimal product mix and the
optimal value.
Solution: Modelling of LPM & Standardizing
Step1: The mathematical model for the microcomputer problem is:
Z max = 60X1 + 50X2
St: 4X1 + 10X2  100
2X1 + X2  22
X1 + 3X2  39
X1, X2  0

Step2: The Standardised form:


Z max = 60X1 + 50X2 + 0 S1 + 0 S2 + 0 S3
St: 4X1 + 10X2 + S1 = 100
2X1 + X2 + S2 = 22
X1 + 3X2 + S3 = 39
X1, X2, S1, S2, S3  0
Step3: Initial Tableau

.
Step 5: Revise the rows
a. Divide each element of the pivot row by the pivot element to get the
corresponding values in the new tableau. The pivot element become 1.
b. For each row other than the pivot row, Perform row operations to make
all other entries for the pivot column equal to zero.

1/2R2 NewR2 1 0.5 0 0.5 0 11


4NewR2 -4 -2 0 -2 0 -44
+ R1 4 10 1 0 0 100
0 8 1 -2 0 56
3NewR2 -3 -1.5 0 -1.5 0 -33
+ R3 3 3 0 0 1 39
0 1.5 0 -1.5 1 6
Step 6: 2nd Tableau

.
Step 5: Revise the rows

1/1.5R3 NewR3 0 1 0 -1 0.667 4


8NewR1 0 -8 0 8 -5.333 -32
+ R1 0 8 1 -2 0 56
NewR1 0 0 1 6 -5.33 24
1.5NewR2 0 -0.5 0 0.5 -0.333 -2
+ R2 1 0.5 0 0.5 0 11
Newr2 1 0 0 1 -0.333 9
•Here, all Cj-Zj row values are zeros and negatives, you have reached optimality.
–Optimum solution is at X1 = 9, X2 = 4 and S1 = 24 and the amount of profit is $740.
Minimize Z with inequalities of
all constraints in “≥” form.
• The iteration procedure is similar to maximization problem except:
– Standardization involves:
• subtraction of Surplus variable (-S) and addition of Artificial variable (A)
• Addition of the coefficient +M to standardize the problem in the OF
– The selection of variable to enter the solution (Pivot Colum) is based on
the most/largest negative value in the Cj-Zj row
– The optimal value is obtained if all elements of Cj-Zj ≥ o
– In all cases we follow similar procedures as maximization case.
Standardization of the minimization model:
• In case of all constraints ≥ type:
 two variables are introduced: surplus variable & artificial variable
• Surplus Variable (-S):
• is a variable inserted in a greater than or equal constraint to create
equality b/n the LHS constraint and the RHSQ
o The variable “-S2” is called a surplus variable, because it is the amount by
which the left side of the inequality exceeds (surplus) the RHSQ.
o Therefore, surplus variable is subtracted from a ≥ constraint in the
process of converting the constraint to standard form.
Cont.
–Example:
–In constraint 2x1 + 3x2 ≥ 90, if we give values to x1 and x2 such that the sum
is greater than or equal to 90, say, x1 = 40 and x2 = 10,
 then 2x1 + 4x2 = 110 which is > 90.
–To make it equal to 90 we have to subtract 20, so that 80 + 30 – 20 = 90.
–When we know the values, we can do this.
–But as we do not know the values of x and x2 before solving the problem, we
have to subtract a surplus variable,
–Surplus variabl generally represented by ‘-S1’, ‘-S2’, ‘-S3’…“-Sn”
–If we do this then the inequality 2x1 + 4 x2 ≥ 90 will be 2x1 + 4x2 – 1S1 = 90.
Cont.
• An artificial variable: Is a variable that has no meaning in a physical sense but
acts as a tool to create an initial feasible LP solution.
• given 2x1 + 4x2 – 1S1 = 90, if x1 and x2 are non-basic variables (x1 = 0, x2 = 0) in
the problem, then S1 is taken as the starting basic variable.
2(0) + 4(0) – 1S1 = 90 => S1 = -40
• But the value of S1 = -40 is infeasible.
• It is against to the rules of lp as all values of decision variables of lp problem
must be ≥ 0 (negativity constraints restriction).
• Thus we cannot proceed with the further iteration of the simplex method with
infeasible basic solution.
• This violation demands the addition of other variable called artificial variable.
• The artificial variable, A, is introduced for each equality type ( = ) or ≥ type
constraint.
Cont.
• In the ≥ or = type cases there may not be any unit matrix/identity matrix/ in
the standard form of the coefficient matrix.
• Artificial variable has no physical meaning. It is introduced solely for the
purpose of:
1.obtaining a basic initial feasible solution and
2.satisfying the non-negative constraint.
3.creating unit matrix so that simplex method is applied
• Now by introducing artificial surplus variable, we can write
2x1 + 4x2 – 1S1 ≥ 90 as 2x1 + 4x2 – 1S1 + 1A1 = 90.  
• If values of x, y, and S1 are equal to zero, then 1A1 = 40. The artificial surplus
variable has the value 90, a positive integer.
• Hence we start our initial programme with the artificial variables, A1, A2,
A3… An and go on replacing them by decision variables as x1, x2, x2 etc.
Cont.
• Artificial variable causes violation of the equality of the corresponding
constraints and causes the infeasibility of the lp.
• Since artificial has no physical meaning it need to be eliminated from basic
variables.
• The presence of artificial variable in basics in the final phase of iteration
indicate infeasible solution of the problem
• The question is how to remove the artificial variables from basic solution?
• There are two alternative artificial variable techniques: The Big-M
technique and 2. the Two Phase Method.
• In this course we will limit ourselves to the Big Method techniques because this
easier and time saving than two phase method.
Cont.
• In which Constraint type and how we use additional Variables?

Type of constraint To put into standard form


< -------------------------------------Add a slack variable
= -------------------------------------Add an artificial variable
> ---------------------- Subtract a surplus variable and add A variable
The Big M-method /Charnes Penalty Method/
• The Big M is added to the OF as the coefficient of artificial variable (A).
• The Big M Method is used for removing artificial variables (A) from the
basis (basic variables).
• In this method, we assign coefficients to artificial variables, undesirable
from the objective function point of view:
– If objective function Z is to be minimized, then a very large positive price
(called penalty) designated by +M is assigned to each artificial variable so
that the profit comes down.
– If Z is to be maximized, then a very large negative price (also called
penalty) designated by -M is assigned to each of the artificial variables so
that the cost goes up.
• Therefore the simplex method tries to reduce the artificial variable to the
zero so that the feasibility is restored and the objective function is optimized.
Cont.
• The only drawback of the big M method is that the value of M is not
known but it is a very large number. Therefore we cannot develop
computer program for this method.
• The value of M must be chosen sufficiently large so that the artificial
variable would not be part of any feasible solution.
• If the basic variables/optimal solutions do not contain any artificial
variable, then the problem has solution.
• If the optimal solution contains any artificial variables in the basis (i.e.
positive values) then the problem is infeasible.
Characteristics of Big-M Method:
Following are the Characteristics of Big-M Method:
a) High penalty cost (or profit) is assumed as M means in millions.
b) M is assigned to artificial variable A in the objective function Z.
c) can be applied to minimization as well as maximization problems with the
following distinctions:
 Minimization problems - -Assign +M as coefficient of artificial variable A
in the objective function Z
 Maximization problems: - assign –M as coefficient of artificial variable
A in the objective function Z
Cont… Characteristics of Big-M Method

d) Coefficient of S (slack/surplus) takes zero values in the


objective function Z
e) For minimization problem, the incoming variable corresponds
to the highest negative value of Cj-Zj.
f) Solution is optimal when there is no negative value of Cj-Zj.
(For minimization case)
Test of optimality
– If all Cj - Zj > 0, then the basic feasible solution is optimal (Minimization case).
– If all Cj - Zj < 0, then the basic feasible solution is optimal (Maximization
case).
• Example:
Min Z= 3x1 + 4x2
St: 2x1 + 3x2 ≥ 90
4x1 + 3x2 ≥ 120
• Compute for the optimal solution and optimal value
Solution: step 1: standardise model
Min Z =3x1+4x2 +0S1+0S2+ MA1+ MA2
St: 2x1 + 3x2 - S1 - 0S2+ A1 + 0A2 = 90
4x1 + 3x2 - S1 – S2 + 0A1 + A2 = 120
x1, x2, S1, S2, A1, A2 ≥ 0

In short:
Z min =3x1+4x2 +0S1+0S2+ MA1+ MA2
St: 2x1 + 3x2 - S1 + A1 = 90
4x1 + 3x2 – S2 + A2 = 120
x1, x2, S1, S2, A1, A2 ≥ 0
Cont.

RR= Q÷KC
90÷2 = 45
120÷4 = 30

A2 is
leaving/exitin
g variable

The largest negative value- entering variable is x1


Revise Old rows for next Tableau

• Note:
• Once an artificial variable has left the basis, it has served its
purpose and can therefore be removed from the simplex tableau.
• The left artificial variable should be removed from both program
variables and objective function
• An artificial variable is never considered for re-entry into the
basis.
• If artificial variable is available after the optimal value obtained,
this indicates that such lP problem has infeasible solution.
Cont… Revise the old rows:

1. Revise the key row (R2) to get the new R2


¼ R2 = 1 ¾0 -1/4 0 30 = new R2
 Note: A2 is removed

2. Revise the Old R1: -2R2 + old R1


-2(new R2) = -2 -3/2 0 1/2 0 -60
+ old R1 = 2 3 -1 0 1 90
0 3/2 -1 1/2 1 30 = new R1
Cont.
Revise the old rows:
1. Revise the key row (R1) to get the new R1
2/3 R1 = 0 1 -2/3 1/3 20 = new R1
Note: now A1 is removed
2. Revise the Old R2: -3/4R1 + old R2
-3/4(new R1) = 0 -3/4 1/2 -1/4 -15
+ old R1 = 1 3/4 0 -1/4 30
1 0 1/2 -1/2 15 = new R2
3rd Tableau
X1 X2 S1 S2
Basis Cj Q
3 4 0 0
x2 4 0 1 -2/3 1/3 20
x1 3 1 0 1/2 -1/2 15
Zj 3  4  -7/6   -1/6
Cj - Zj  0  0 7/6  1/6 

• Since all the numbers in the index row (Cj – Zj row) are either zero or positive,
the optimal solution has been arrived or realized.
• The optimal solution is given as; x1 = 15, x2 = 20 & minimum cost is = $125
• As long as an “A” variable is available in the solution variable column, the
solution is infeasible.
• In this case no A in solution variable column. Thus LP problem is feasible
problem or has feasible solution
Example 2: Solve the following problem using Big M method

Minimise Z = 3x + 2.5y s.t


2x + 4y ≥ 40
3x + 2y ≥ 50
x, y, ≥ 0.

Step 1: standardize model by adding slack (if any), surplus and artificial
variables to the left handed of the constraints.
• Minimise Z = 3x + 2.5y + 0p + 0q + MA1 + MA2 s.t
2x + 4y – 1S1 + 0S2+ 1A1 + 0A2 = 40
3x + 2y + 0S1 – 1S2 + 0A1 + 1A2 = 50
x, y, p, q, A1, A2 ≥ 0.
Cont.
• Step 2:
• use the artificial variable for the starting solution and proceed with
the usual simplex routine until the optimal solution is obtained.
• The initial basic solution consist of artificial variables:
– A1 = 40,
– A2 = 50
• The non-basic variables include x = 0, y = 0, p = 0, q = 0,
Step 3: develop the Initial table of Simplex

Key row Key column Key number


Determine the entering & exiting variables
• Now take 6M & 5M, 6M is greater and if we subtract 2.5 from that it is
negligible. Hence –6m will be the lowest element/the largest negative value
• The physical interpretation is if patient purchases Y now, his cost will be
reduced by an amount 6M. In other words, if the patient does not purchase the
Y at this point, his penalty is 6M, i.e., the opportunity cost is 6M.
• As the non-basis variable Y has highest opportunity cost (highest element
with negative sign), Y is the incoming variable.
• Hence, the column under Y is key column.
• To find the out going variable, divide requirement(quantity) column element
by key column element and find the replacement ratio.
• Select the lowest ratio, i.e., here it is 10, falls in first row, hence A1 is the out
going variable.
Revise the old rows
• Now remove A1 both from basic variables and objective functions.
1. Revise the key row by dividing it by key number (i.e., 4):
¼ R1 = 10 0.5, 1, – 0.25, 0 0

2. Revise R2: -2new R1 + old R2


-2new R1: -20 -1 -2 .5 0 0
+ old R2: 50 3 2 0 -1 1
30 2 0 .5 -1 1 = new R2
Cont.

4
¼ R1 = 10 0.5 1 – 0.25 0 0 = New R1

Convert
the Key n
umber to
1
Cont.

¼ R1 = 10 0.5 1 – 0.25 0 0 = New R1


con ver t 2 to
zero(0)
. Revise R2: -2new R1 + old R2
-2new R1: -20 -1 -2 .5 0 0
+ old R2: 50 3 2 0 -1 1
30 2 0 .5 -1 1 = new R2
Step 4: Develop Tableau: 2.

Key Row Key number


Key row
Revise the old rows
• Now remove A2 both from basic variables and objective functions.
1. Revise the key row by dividing it by key number (i.e., 2):
½ R2 = 15, 1, 0, 0.25, -.5

2. Revise R1: -2new R1 + old R2


-0.5new R1: -7.5 -.5 0 .125 0
+ old R1: 10 0.5 1 -.25 0 -
2.5 0 1 -0.125 0 = new R1

30/2 =15, 2/2 =1, 0/2 =0, 0.5/2 =0.25, –1/2 = –0.5, –0.5/2 = –0.25, 1/2
= 0.5.
Fist Revise Key row

2
½ R2 = 15 1 0 .25 -.5

Key Row Key number


Key row
Revise key row

NewR2= 15 12 0 .25 -.5


Revise R1: -.5new R1 + old R2

-0.5new R1: -7.5 -.5 0 -.125 .25

-.5new R1 + old R2: 2.5 0 1 -0.375 .25 = New R1


Step 5: Table: 3.
Now remove A2 both from basic variables and objective functions.

51.25.

• Imputed value (2.5 x 2.5) + (3x 15)= $51.25.


• As all the elements of net evaluation row are either zeros or positive elements the solution
is optimal.
• The patient has to purchase 15 units of X and 2.5 units of Y to meet the requirement
and the cost is $ 51.25
Example
• Solve by using Big -M method the following L.P.P:
• Max Z = -2x1 –x2
St: 3x1 + x2 = 3
4x1 + 3x2 ≥ 6
x1 + 2x2 ≤ 4
x1 & x2 ≥ 0
• Step 1: Introducing slack, surplus and artificial variable, the system of constraint equations become:
• Max Z = -2x1 –x2+0S1 +0S3+0A1+ 0A2
St: 3x1 + x2 + A1 = 3
4x1 + 3x2–S1 + A2 = 6
x1 + 2x2+ S3 = 4
x1 & x 2 ≥ 0
Table 3:
-2 -1 0 0
BV X1 x2 S2 S3 Q
X1 -2 1 0 1/5 0 3/5 X1 = 3/5
x2 -1 0 1 -3/5 0 6/5 X2 = 6/5
S3 0 0 0 6/5 2 12/5 S3 = 12/5
Zj -2 -1 1/5 0 21/5 Max Z = -12/5
Cj-Zj 0 0 -1/5 0
 Final optimal solution obtained because Cj-Zj values for all
variables are ≤ 0.
 Z value indicates loss for the company.
Variables to Create Initial Feasible LP
•  Type of constraint To put into standard form
< --------------------------------------------- Add a slack variable
= --------------------------------------------- Add an artificial
variable
> ---------------------- Subtract a surplus variable and add artificial
variable
.
Limitations of linear programming

• In linear programming uncertainty is not allowed, i.e., LP methods are


applicable only when values for costs, constraints, etc. are known, but in real
life such factors may be unknown.
• According to the LP problem, the solution variables can have any value,
whereas sometimes it happens that some of the variables can have only
integral values.
– For example, in finding how may machines to be produced; only integral
values of decision variables are meaningful. Except when the variables
have large values, rounding the solution to the nearest integer will not
yield an optimal solution. Such situations justify the use of Integer
Programming.
• Many times (in real life), it is not possible to express both the objective
function and constraints in linear form.
Summary on extra variables to convert the constraints to standard form

Coefficient of extra Presence of


variables in the OF variables in the
Types of Extra variables to be For Max Z & Min Z initial solution
constraint added respectively mix

<  Add only slack variable 0, 0 Yes

Subtract surplus 0, 0 No
variable and
>  Add artificial variable -M, +M Yes
 
= Add artificial variable -M, +M Yes
is
n
tio d
es me
Qu co
el
W
Comments
Any

u
Yo
nk d!
ha en
IT e
Th

You might also like