















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Operations Research (OR) refers to the science of decision making. This course elaborate like linear, nonlinear and discrete optimization. This lecture handout was provided by Sir Avikshit Gupte. It includes: Artificial, Variable, Technique, Feasible, Negative, Simplex, Constraints, Iteration, Indefeasible
Typology: Lecture notes
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















If slack variables do not provide an initial basic feasible solution then the question may arise as to how to start the initial table of simplex method and proceed. This is the case when the slack variables have negative values.
For example, let us consider a constraint 2 x + 3 y > 15
The method of converting this inequaly (with greater than equal to) into an equation, is to subtract a slack variable so that we have 2 x + 3 y - S = 15
Now if x and y are non-basic variables in the problem, then S is taken as the starting basic variable. But the value of S = -15 which is infeasible. We cannot proceed with the further iteration of the simplex method with infeasible basic solution.
So to obtain a starting solution, we adopt the 'artificial variable' technique. Two methods are available using the artificial variables. They are,
(1) The "Big M technique" or the Charnes method of penalty. (2) The two phase technique.
The 'Big M' Technique
If some of the constraints in the linear programming problems are of the type ( > ) or ( = ), we have to use the M technique for maximization as well as minimization of an objective function. The various steps of the M technique are given below.
STEP 1 Express the given linear programming problem in the equation form by bringing all the terms in the objective function to the left hand side and the constraints are also expressed in the equation form by including slack variables (Add slack variable for constraint of the type < and subtract slack variable for constraint of the type > ).
Now obtain a basic solution for the problem, which will be an infeasible one as the basic variable is negative in the cases where the constraints are of the type ( > ).
STEP 2 To get a starting basic feasible solution, add n0n-negative variables to the left hand side of each of the equations corresponding to the constraints of the types ( > ) and ( = ). These variables are called artificial variables. Thus we change the constraint to get a basic solution. This violates the corresponding constraints. This is only for the starting purpose. But in the final solution (if it exists) if the artificial variables will become non-basic, (their values will be zero) then we are coming back to the original constraints. This method or driving the artificial variables out of the basis is called the Big M technique. This result is achieved by assigning a very large (big) per unit penalty to these variables in the objective function. Such a penalty will be a -M for maximization and a +M for minimization problems, on the right hand side, the value of M being strictly positive. By attaching these per unit penalties to the artificial variables we ensure that they will never become the candidates for entering variables once they are driven out.
STEP 3 For the starting basic solution; use the artificial variables in the basis. Now the starting table in the simplex procedure should not contain the terms involving the basic variables, (one of the conditions to be satisfied by the
simplex method). But we will have the terms like +MA or -MA in a maximization or minimization problem respectively in the left hand side of the objective row. In other words, the objective function must be expressed in terms of non-basic variables only. This leads us to have the coefficients of the artificial variables (starting basic variables) equal to zero in objective row. This result is obtained by adding suitable multiples of the constraint equations involving artificial variables to the objective row.
STEP 4 Proceed with the regular steps of the simplex method. If the artificial variables leave the basis in the final solution, then we come back to the original problem. But if any or all of the artificial variables do not leave the basis in the final solution, then this indicates that the problem does not have a solution.
Example
Consider the problem Maximize Z = 2 x + 5 y
Subject to x < 40, y < 30, x + y > 60, x, y > 0
Solution
STEP 1 Bring the problem to the standard form by including slack variables.
Z - 2 x - 5 y = 0 x + S 1 = 40 y + S 2 = 30 x + y + S 3 = 60
Solution at this stage is
1 2 3
30 Basic variables 60
Non-basic variables 0
Z S S S x y (^)
STEP 2 Since S 3 = -60 and as such is infeasible; add an artificial variable A to get an initial basic solution. Then we
have the third constraint equation changed to x y S 3 (^) A 60
STEP 3 Modify the objective function by including a very large per unit penalty M. Thus for maximization problem we add -MA to RHS of the objective function which will be
Z 2 x 5 y MA
or
Second Iteration: x enters and A leaves the basis.
Eqn. No.
Basic Variable
Coefficient of RHS Ratio Z x y S 1 S 2 S 3 A 0 - 1 0 0 0 7 -2 2+M 210 1 S 1 0 0 0 1 1 1 -1 10 10 2 y 0 0 1 0 1 0 0 30 ∞ 3 x 0 1 0 0 -1 -1 1 30 -
Third Iteration: S 3 enters and S 1 leaves the basis.
Eqn. No.
Basic Variable
Coefficient of RHS Z x y S 1 S 2 S 3 A 0 - 1 0 0 2 9 0 M 230* 1 S 3 0 0 0 1 1 1 -1 10 2 y 0 0 1 0 1 0 0 30 3 x 0 1 0 1 0 0 0 40
From the above table, we see that there is no negative coefficient in the objective row. This indicates that we have reached the optimal solution to the problem.
Another fact which can be noticed that the artificial variable A has left the basis.
Hence we have the original constraint and the original objective function preserved.
The optimal solution
x = 40 y = 30 S 3 = 10 and S 1 = S 2 = A = 0
Example Using surplus and artificial variable, solve the following:
Minimize Z = 5 x 1 + 6 x 2 Subject to 2 x 1 + 5 x 2 > 1500 3 x 1 + x 2 > 1200 x 1 , x 2 > 0
Solution
Introducing slack (surplus) variables S 1 and S 2 and artificial variables A 1 and A 2 to the two constraints the problem becomes,
Minimize Z = 5 x 1 + 6 x 2 + MA 1 + MA 2
Subject to 2 x 1 + 5 x 2 - S 1 + A 1 = 1500 3 x 1 + x 2 - S 2 + A 2 = 1200
Since the objective function should not involve coefficient of basic variables A 1 and A 2 , we multiply the constraint equation with M and add to the objective function. The revised objective function will be
Z - 5 x 1 + 5 Mx 1 - 6 x 2 + 6 Mx 2 - MS 1 - MS 2 = 2700 M
We prepare the simplex table as follows:
Initial table:
Eqn. No.
Basic variable
Coefficient of RHS Ratio Z x 1 x 2 S 1 S 2 A 1 A 2 0 - 1 5M-5 6M-6 -M -M 0 0 2700M 1 A 1 0 2 5 -1 0 1 0 1500 300 2 A 2 0 3 1 0 -1 0 1 1200 1200
Divide the equation 1 by 5 throughout.
Eqn. No.
Basic variable
Coefficient of RHS Ratio Z x 1 x 2 S 1 S 2 A 1 A 2 0 - 1 5M-5 6M-6 -M -M 0 0 2700M 1 A 1 0 2/5 1 -1/5 0 1/5 0 300 300 2 A 2 0 3 1 0 -1 0 1 1200 1200
First Iteration: x 2 enters and A 1 leaves the basis.
Eqn. No.
Basic variable
Coefficient of RHS Ratio Z x 1 x 2 S 1 S 2 A 1 A 2 0 - 1 13M- 5
1 x 1 0 2/5 1 -1/5 0 1/5 0 300 750 2 A 2 0 13/5 -1 1/5 -1 -1/5 1 900 346
Second Iteration: x 1 enters and A 2 leaves the basis.
Multiply Eqn. 2 by 5/13 to make the key number 1. Then we have
Eqn. No.
Basic variable
Coefficient of RHS Z x 1 x 2 S 1 S 2 A 1 A 2 0 - 1 0 0 0 -1 -M+1 -M+1 2700 1 x 2 0 0 1 -15/65 2/13 3/13 -2/13 2100/ 3 2 x 1 0 1 0 1/13 -5/13 -1/13 5/13 4500/ 3
Since the equation 0 does not contain positive coefficient of the variables, the solution found is the optimum.
Solution: Z* = 2700, x 1 = 4500 / 13, x 2 = 2100 / 13
Example Minimize Z = 4 x 1 + x 2
Subject to 3 x 1 + 4 x 2 > 20
The second constraint can be changed into inequality of the type by multiplying by -1 throughout. Then introduce slack variable and artificial variable to the two constraints. The equations are transformed into
Z -4 x 1 - x 2 - MA 1 - MA 2 = 0 3 x 1 + 4 x 2 - S 1 + A 1 = 20 x 1 + 5 x 2 - S 2 + A 2 = 15
The objective function should not involve the coefficients of basic variables A 1 and A 2. So, multiply the constraint equation by M and add to the objective equation. Then we get the following equations.
Z - 4 x 1 + 4 Mx 1 - x 2 + 9 Mx 2 - MS 1 - MS 2 = 35 M 3 x 1 + 4 x 2 - S 1 + A 1 = 20 x 1 + 5 x 2 - S 2 + A 2 = 15
The above equations can be conveniently set down in the Simplex table as shown below.
Initial table: Eqn. No.
Basic variable
Coefficient of RHS Ratio Z x 1 x 2 S 1 S 2 A 1 A 2 0 - 1 4 M -4 9 M -1 - M - M 0 0 35 M 1 A 1 0 3 4 -1 0 1 0 20 5 2 A 2 0 1 5 0 -1 0 1 15 3
Divide equation 2 by 5 to make the key No. 1. Thus we have
x 1 = 40/ x 2 = 25/
The Two Phase Method
A difficulty is being encountered in the use of M technique in that there is a possible computational error that could result from giving a very large value of M. By this the objective coefficients of the variables x and y are now too small compared with the large numbers created by the multiples of M. The solution may become insensitive to the relative value of the original coefficients of the decision variables x and y due to the round off error which is inherent in any digital computer. The result could be that both may have equal coefficients in the objective function. To overcome this difficulty another method namely two phase method is presented below. This method involves two phases which are:
Phase 1 : Replace the original objective problem by the sum of the artificial variables to formulate a new problem. Then this new objective function is then minimized subject to the constraints of the original problem. If the problem has a feasible solution, the minimum value of the objective function will be zero which shows that all the artificial variables are zero. Then proceed to phase II. Otherwise, if the minimum value is greater than zero, we conclude that the problem has no feasible solution.
Phase II : Use the optimum basic solution of phase I as a starting solution for the original problem. Now the original objective function has to be expressed in terms of the non-basic variables only. This can be achieved by adding suitable multiples of the constraint equations involving artificial variables.
Example
Consider the problem Maximize Z = 2 x + 5 y Subject to x < 40 y < 30 x + y > 60 x, y > 0
Solution:
We try to solve this problem by the two-phase method.
Introduce slack variables S 1 and S 2 for the first two constraints respectively. Subtract a slack variable S 3 and add an artificial variable A for the third constraint so that the third constraint is changed into x + y - S 3 + A = 60. In this problem we have the new objective function expressed as minimization of the sum of artificial variables. We have only one artificial variable.
Phase I Minimize Z = A (0)
Subject to x + S 1 = 40 (1) y + S 2 = 30 (2)
x + y - S 3 + A = 60 (3)
Note that the objective function is always of the minimization irrespective of whether the original problem is maximization or minimization of the objective function.
We prepare the initial table as follows:
From the above table we see that the objective function Z = 0 and A has left the basis. Hence A becomes a non-basic variable. This is the indication that the problem has a feasible solution and we can proceed to phase II, which is explained below.
Phase II: In the phase II, a table is prepared with the objective function and the set of constraints tabulated in the final table of Phase I omitting the column of the artificial variable, as it is non-basic. In preparing the table the objective function has to be expressed in terms of the non-basic variables only. In other words, the coefficients of the basic variables must be zero.
Eqn. No.
Basic variable
Coefficient of RHS Z x y S 1 S 2 S 3 0 - 1 -2 -5 0 0 0 0 1 x 0 1 0 1 0 0 40 2 S 2 0 0 0 1 1 1 10 3 y 0 0 1 -1 0 -1 20
In the above table, x and y are basic variables and their coefficients are -2 and -5 respectively. Hence the objective function must be rearranged to make the coefficients of x and y as 0. This is obtained by multiplying the equation (1) by 2 and the equation (3) by 5 and adding this to the objective row. We have the following starting table with the revised objective function.
Eqn. No.
Basic variable
Coefficient of RHS Ratio Z x y S 1 S 2 S 3 0 - 1 0 0 -3 0 -5 180 1 x 0 1 0 1 0 0 40 ∞ 2 S 2 0 0 0 1 1 1 10 10 3 y 0 1 1 -1 0 -1 20 -
The original problem is one of maximization and hence in the first iteration S 3 enters and S 2 leaves the basis.
First Iteration:
Eqn. No.
Basic variable
Coefficient of RHS Z x y S 1 S 2 S 3 0 - 1 0 0 2 5 0 230* 1 x 0 1 0 1 0 0 40 2 S 3 0 0 0 1 1 1 10 3 y 0 0 1 0 1 0 30
We get the optimum value of Z in the above table as no negative coefficient is present in the objective function row.
Solution:
Z = 230, x = 40, y = 30, S 3 = 10, S 1 = S 2 = 0.
(i) Develop a mathematical model. (ii) Solve it for maximizing the total effective audience.
(i) Share A will earn a divided of 12% per annum and share B 4% per annum. (ii) Growth in the market value in one year of share A will be 10 paise per Re. 1 invested and in B 40 paise per Re. 1 invested.
He requires investing minimum total sum which will give
Your are required to
(i) State the mathematical formulation of the problem. (ii) Compute the minimum sum to be invested to meet the manager's objective by using simplex method.
Product Operating x y z cost/hr (Rs.)
Plant A 2 4 3 9 Plant B 4 3 2 10
Subject to x 1 + 2 x 2 + 3 x 3 = 15 2 x 1 + x 2 + 5 x 3 = 20 x 1 + 2 x 2 + x 3 + x 4 = 10 x 1 , x 2 , x 3 , x 4 > 0
Maximize Z = x 1 + x 2
Subject to 3 x 1 + 2 x 2 < 20 2 x 1 + 3 x 2 < 20 x 1 + 2 x 2 > 2 x 1 , x 2 > 0
In this section we present certain complications encountered in the application of the simplex method and how they are resolved. These are called the variants of simplex method. We can illustrate the typical cases through numerical examples. The following variants are being considered.
Minimization:
Sometimes we come across problems in which the objective function has to be minimized instead of maximizing. This situation can be tackled easily in either of the two ways. One is to make the following minor changes in the simplex method. The new entering basic variable should be the non-basic variable that would decrease rather than increase the value of Z at the fastest rate when this variable is increased. Similarly the test for the fastest rate when this variable is increased. Similarly the test for optimality should be whether Z can increase. Similarly the test for optimality should be whether Z can be decreased rather than increased by increasing any non- basic variable.
The second method is to change the problem into an equivalent problem involving maximization and proceed with the steps of the regular simplex method. The change is effected by maximizing the negative of the original objective function. Minimizing any function f ( x 1 , x 2 , x 3 , ..., x n) subject to set of constraints is completely equivalent to maximizing - f ( x 1 , x 2 , ..., x n) subject to the same set of constraints. For example if we want to minimize a function Z = 5 x 1 +7 x 2 - 8 x 3 , it is equivalent to maximizing a function Z = -5 x 1 - 7 x 2 + 8 x 3.
Inequality in the wrong direction.
The sign or direction of inequality can easily be reversed when both sides are multiplied by -1. Therefore, if the constraint has inequality of the type ( > ), the same can be converted into the desired inequality of the type ( < ) by multiplying both sides by -1. To illustrate consider the inequality 2 x + 5 y > 18. This is equivalent to -2 x - 5 y < -
Tie for the Leaving Basic Variable (Degeneracy).
The question may arise as to which of the basic variable to be selected to leave the basis when many basic variables reach zero (as indicated by equal values in the ratio column) as the entering basic variable is being changed. Thus there is a tie between or among the leaving basic variables. Of course the tie can be broken arbitrarily. This leads, in the next iteration, the basic variables to take value zero, in which case the solution is said to degenerate. There is no assurance that the value of the objective function will improve (Since the new solutions may remain degenerate).
Consider the following example:
Example Maximize Z = 2 x + 5 y
Subject to x < 40 y < 30 x + y < 30 x, y > 0
Introducing slack variables, the problem is expressed in the standard form.
Z - 2 x 5 y = 0 (1) x + S 1 = 40 (2) y + S 2 = 30 (3) x + y + S 3 = 30 (4)
Starting table
Eqn. No.
Basic Variable
Coefficient of RHS Ratio Z x y S 1 S 2 S 3 0 - 1 -2 -5 0 0 0 0 1 S 1 0 1 0 1 0 0 40 ∞ 2 S 2 0 0 1 0 1 0 30 30 3 S 3 0 1 1 0 0 1 30 30
There is a tie between S 2 and S 3 as to which to be selected as to which to be selected as leaving the basis. Select arbitrarily S 3 as the leaving basic variable.
First Iteration: S 3 leaves the basis and y enters.
Note that the value of the variables in the first and second iterations is the same. At both iterations one of the basic variables is zero. If there is an indication of degeneracy in the first iteration itself, why don't we stop at the iteration when a degenerate solution appears? But we are not sure that this will coincide with the optimal. The optimal solution may not be degenerate.
Example (Temporary Degenerate Solution)
Minimize Z = 2 x + y Subject to 4 x + 3 y < 12 4 x + y < 8 4 x - y < 8 x , y > 0 Solution: Introducing slack variables, we get
Z - 2 x - y = 0 4 x + 3 y + S 1 = 12 4 x + y + S 2 = 8 4 x - y + S 3 = 8
Starting table:
Eqn. No.
Basic Variable
Coefficient of RHS Ratio Z x y S 1 S 2 S 3 0 - 1 -2 -1 0 0 0 0 1 S 1 0 4 3 1 0 0 12 3 2 S 2 0 4 1 0 1 0 8 2 3 S 3 0 4 -1 0 0 1 8 2
First Iteration: x enters the basis and S 2 leaves
Eqn. Basic Coefficient of RHS Ratio
No. Variable Z x y S 1 S 2 S 3 0 - 1 0 - 1/2 0 1/2 0 4 1 S 1 0 0 2 1 - 1 0 4 2 2 x 0 1 1/4 0 1/4 0 2 8 3 S 3 0 0 - 2 0 - 1 1 0 -
Note: S 3 cannot leave the basis according to the feasibility condition.
Second Iteration: y enters and S 1 leaves the basis.
Eqn. No.
Basic Variable
Coefficient of RHS Z x y S 1 S 2 S 3 0 - 1 0 0 1/4 1/4 0 5 1 y 0 0 1 1/2 -1/2 0 2 2 x 0 1 0 -1/8 -3/8 0 3/ 3 S 3 0 0 0 1 -2 1 4
The optimal solution is Z = 5, x = 3/2, y = 2, S 3 = 4, S 1 = S 2 = 0.
Note that the solution in the first iteration is degenerate while the solution in the second and final iteration is non-degenerate. Hence the problem is temporarily degenerate.
Sometimes it is possible that the simplex iterations will enter a loop which will repeat the same sequence of iterations without ever reaching an optimal solution. This peculiar problem is known as "cycling" or "circling" in linear programming. But the occurrence of such type of problem is very rare in practice. However, there are procedures developed to overcome such situations. Since it is rare the discussion is skipped.
Unbounded solution