 class we have seen that if you have given a minimization problem and it is subject to linear equations. And objective function is linear and subject to the constants the constant also linear then it is called as a linear programming problem. And we have given a basic idea how to solve that type of problem by considering that two variables two class of variables one is basic variables another is non-basic variables. Then non-basic variables which are the we will assign as a non-basic variable that variables values we are assigned to a 0 and in turn we get a basic variables values. Then we shift one of the non-basic variable values we convert into a basic variables and one of the basic variables is converted into a non-basic variables. And which non-basic variable which basic variable will be converted into a non-basic variable and non-basic variable which one will converted into a basic variable that we have discussed yesterday. Let us see that what we can do with the what is called in algebraic approach matrix and vector form. So, numerical method of solving the linear programming is known as the simplex method. So, let us call the algebraic we are just discussed the algebraic approach to solve linear programming problem. This method is an algebraic approach the algebraic approach or numerical method that way we will solve the linear programming problem is known as the simplex method. So, let us call our minimization problem minimize f of x, x dimension is n cross 1 and decision variables are there and that we have written into a c transpose x n cross 1. Immediately you know what is the dimension of the f is a scalar function objective function is a scalar we have defined. So, this we partition into two parts this c transpose matrix we partition into two parts c b transpose partition c d transpose that c b transpose will be associate with the basic variables x b and x n non basic variables which is denoted by n. The dimension of this x b vector is m and this dimension from here to here this dimension is n minus m. So, and subject to what this objective function is linear function and subject to our constant and that constant is a set of linear equation in terms of x variables and x is n components. So, we have a x which is n components are there is equal to b and we have a m number of linear equations. So, this dimension automatically it will be m cross n. So, this also we have partition accordingly our what is called basic variable associate with the basic variable and non basic variable the matrix a is partition into two parts b partition d. Then this x b then x n is equal to b cross 1 and this dimension immediately you see this is m rows and this is b as m rows and this as a you can say this as a n minus m rows. So, this a is partition b into b and d. So, and we are then x all components of x is greater than equal to 0. In other words we can write this x is partition into two parts x b which is a basic variable that values are non 0 and x n which is a non basic variable this values are also greater than equal to this value is equal to 0 this is n is equal to 0 this. So, this we have partition that x values are greater than 0 then we have partition x b and x n. So, if we consider that our non basic variable are x last n minus m variables are non basic variable that values will be assigned to a 0. So, this dimension is n minus m into 1. So, from this is let us call this is a set of equation which is equation number of 1 this. So, if we consider the non basic variables x n x n is equal to 0 then from 1 we can write it from 1 from 1 we can write it c b into x b plus d into x n is equal to b. But this value is we have considered non basic variable which is is equal to 0. So, we will get a basic solution and that basic solution must be a feasible solution feasible solution means x is greater than equal to 0 and we have to all constant must be satisfied and this naturally it will be satisfying this one. So, our therefore, our x b is equal to b inverse into small b. So, this is our basic variables we got it. So, our basic variable solution now. So, our basic variable solution are the basic variables basic feasible solution x is what x b and this value you know at this moment and this is x b is b transpose b inverse b and this x n which is equal to 0 this non basic variables. So, this is these values are greater than equal to 0 to this one. So, let us assign this equation number is what we got it this x b value this is a 2 and this is equal to or this equation you give it 2 forget about this equation number you will recall this equation once again. So, and this equation is equation number 3. So, now we can find out that whether there is a next question is what is the corresponding cost function value f of x because we have we have assigned out of n variables. If you see we have assigned n minus 1 m variables is 0 and remaining m variables values we can get it by taking the inversion of b inverse b and that is called basic variables. So, basic feasible solution that what we got it basic feasible solution is this one. Then corresponding function value we can find out what is this function value if you see the our objective function expression this is c b transpose into x b plus c d transpose into x n. So, x n value is 0 and this values we got it is c b transpose and x b value we got it you see b inverse b inverse small b say that value is 0 z 0 say and that is equation number 4. So, basic step of simplex method is there we are now we are now having a feasible solution x from there that vertex if you move to another point in a feasible region. Then we want to see whether that point will reduce the function value from the present vertex or not if it is reduced then we will accept it. So, this is our basic idea of what is called the simplex method what are the feasible solution is there now basic feasible solution we will move to another adjacent feasible point or feasible vertex and at that vertex if the function value is less than the previous point previous adjacent point function value then we will accept that one. So, let us say how logically we will proceed that one. So, this basic step of simplex method is to move to another adjacent feasible point. So, that the function value so that the function value means cost function value value is reduced in such movement in such movement that is the basic idea of simplex method. So, let us call we have a set of linear equations are there and this is the vertex of this one and these are the all feasible region is inside this polygon and this is the vertex let us call this vertex is x u or you can write y this is y u b w z this is y. So, if you move the adjacent vertex I can move to adjacent vertex is here or at this point I know the function value at this point y point. If the adjacent point if I move it if the function value is less than the value of the function at point y then we will accept that feasible solution of this one one of the feasible, but that feasible solution may not be what is called minimum. So, you have to look that any one of this vertices will give you the minimum value of this functions agree. So, this is not the adjacent not adjacent to y adjacent to y is u u is adjacent to y this is adjacent to y z, but w is not adjacent to y. So, you will move immediate adjacent to our present feasible solution whatever we got it. So, let us say with this one that what happens next question will be what happens if the one of the non basic variable x n all non basic variable we have assigned 0. If we change one of the non basic variable to a basic variable means non basic variable all variables value is 0. If one of the non basic variable we make it non 0 then what will be the function value will increase. Next question which non basic variable will increase out of n minus m variables which non basic variables will increase it. So, this is the question. So, if we increase that if we just move that point naturally function value will change increase, because function value will increase that which variable will move it depending on this one function value may increase may decrease also. So, you have to take the judicial decision that which variable of non basic variable will increase its value. So, now question is here what happens if 0 component of x n x capital N it has a n minus 1 component all components are 0s increases to some value. So, what happens if 0 component of the increases to some value the non 0 component of x you see the non 0 component the non 0 component of x b that basic variables values are non 0. The non 0 component of b must drop by b transpose b inverse d x n to maintain equality to maintain equality constraint equation 2. So, equation 2 you see this one. So, if because you see now this d is a matrix all elements of x is 0 out of all this in one element if I increase it if I increase it increase it and corresponding column that corresponding column of d which multiplied by that element of that x n agree. This corresponding element if you multiply by this one that value will not be equal to b until unless there is a drop in this components agree. So, we can write it now from this equation that is what we have written it i minus b i not minus i b inverse d x of b minus b d inverse x n and x n must be equal to the right hand side b inverse b. See here what I did it both side I multiplied by b inverse agree. So, x b now it is writing b inverse d x n agree and right hand side is b inverse b. Now, I am telling you out of n minus m element one of the element is non 0. So, naturally the corresponding element multiplied by that corresponding column of that one this product agree this vectors will is added with this one previously it was 0 is contribution was 0. Now, it is added with this one. So, in order to satisfy right hand side b there must be some component of this one it has to be drop out. So, this is now coming to the picture. So, this I can write it now if you see this one that x n into b if you multiply x b into this then x b inverse what is called b inverse d x n it will be cancelled and ultimately it is x b is equal to b inverse b inverse b. So, this part is increasing and from the x b this part is drop out. So, this is the condition is there if you change one of the variables of x n if you change it there must be a drop in from x b some component of x b must be drop out. So, this now total change or that you can say that changes the cost function is see this curve what is our c b transpose into x b what is x b x b. Now, this whole one x b minus b d inverse x n plus c d transpose this is our perform ending objective function c d transpose into x n this one. So, if I one of the element of x n that out of n minima if one of the element if you change it there must be from x n some x x b vector some has to be drop out. So, that this equation is satisfied this is the thing. So, if you readjust this one I can write that c transpose b and x b x b you can write it this x b is nothing but a b inverse small b plus this term minus this into this c transpose x n minus c b transpose b d inverse x n this is x n this is x n. So, now this is c suffix this is c suffix b c suffix b. So, this is some c suffix b b inverse b this is a our previous point objective function value what is the previous function value. If you change x n to some other value then this changes are coming c d transpose minus c b transpose b d inverse whole x n again I think I here I have written c b c b. So, this is not a c b inverse d b inverse d. So, this is if you manipulate this one c b d inverse this agree b inverse d b d inverse not d inverse b inverse just a minute. So, what we got it that one this is b inverse sorry here you just make it correction because this is b inverse this is b inverse this is not inverse drop this is b inverse this is not drop out agree when you have just x b value is this one then this is your b inverse this is not there this is b inverse this is not there agree this is I mistake here b inverse. So, now you see this term if you see this term f of x is coming f of x is coming z 0 the original point objective function value plus that your c d transpose minus c b transpose b inverse d into x n and let us call I consider this is a r d this is the row vector this is the row vector of dimension n minus m into 1 this because this dimension is n minus 1 n minus m in n row this is the column vector this is row vector. So, I write it is a r d transpose into x n now see this one this function value if I change the non basic variable value from 0 all values are 0 from there if I change it some value some of the element if I change its value. Then the total value of this one is coming the next point is z 0 plus r d transpose into x and this quantity is a scalar now it depends on whether the function value will decrease or increase it depends on the row vector elements of row vector of r d transpose because one element we have to increase because r x x n non the variable is greater than equal to 0 we have to increase it. So, this function value will decrease when if corresponding element of x n corresponding element in r if it is negative because x n is x n that which element you have considered is a positive that corresponding element in r d transpose must be negative. Then there is a possibility of reducing the function value that means. So, we have it this you can write it the cost value you can write the cost value goes up and down up or down that depends on the value of depends on the elements of or you can say on the sign of the vector that means r d transpose is equal to c d transpose minus c b transpose b inverse d this one. Now, let us call if this is a row vector if you consider the all elements of this row vector all elements of the row vector r d transpose all are positive and the x n how many elements are there in of x n vector non-basically there are n minus m elements out of this one element. Let us call I want to change its value from 0 to its value I want to increase it then this function product of this function will be a positive because all elements of this if I consider positive then this product will be positive. So, objective function value is increasing. So, we are now away from the our goal our goal is minimizing the objective functions this one. So, if you think in other way if r d transpose is less than equal to 0 or the elements at least one elements of r d transpose is one element is negative and corresponding element of x n element of x n is positive then product of this one will be a negative one. So, there is a scope of finding the value of f x is finding the value of f x to be reduced agree or to reduce the function of value of f x if you move that point. So, whole thing whether function value will increase or decrease that depends on the r d. So, in short now we can write it that if r d transpose is greater than equal to 0 that means all elements of r d is greater than equal to 0 then r d transpose x n is greater than equal to 0 since x n is greater than 0 you have consider one at least one of the element is non-zero that. So, the best decision is to keep x n is equal to 0 suppose r d is all elements of this and if you consider all elements 0 then x you want to increase it then this product will be greater than 0. That means function value is increasing then it is better whatever the point you are earlier at that point that point you keep it as an optimal point of this feasible solution agree. So, another choice is that as a all the elements of this if at least one element one component of r d transpose is negative at least one out of how many elements are there and minus one elements of r d out of this at least one element is negative then corresponding x n element which is multiplied by x n element that element if you change from 0 to non-basic variable to basic variable to 0 to increase this value the function value will decrease. That is why if at least one component of r d is negative then the cost function cost value can be reduced by increasing by increasing the corresponding component of x n by increasing the corresponding component on x n. So, now if you find that there is a the r d that row vector r d transpose row vector if there is a more than one component more than one component having a negative sign of that r d transpose that row vector element more than one element is having a negative sign then which corresponding I mean variable of that r d you will consider as a basic variable the most negative sign of that numerical values will consider as a basic variable because that will give you the reduction of the function value much than the other negative value of in r d transpose. So, after r d is completed after r d is completed the entering point entering basic point basic variable let us call x i is determined by the largest or most largest negative coefficient of r d transpose it allows that component x i to increase from 0. Next is we have increased this one. So, just now you have mentioned it here if you recollect. So, one of the basic one of the non basic variable is now chosen as a basic variable. Now, one of the basic variable now we have to select as a non basic variable out of m basic variable which basic variable we will consider as a non basic variable that we have to select it next is how now which component of basic variables x b will treat as living basic variable. That means that very basic variable is living and entering as a non basic variable which basic variable will consider that is the next question entering as a this which basic variable living and entering as a non basic variable. So, now recall this our basic expression that is i b trans b inverse d x b x n is equal to b inverse b that is our basic that is our what is called equality constants are there we have written if you recollect b we have recollect this one we have written b partition d then we have a basic variables x b then we have a non basic variable x n is equal to b. So, both side inverse this is a square matrix this is a square matrix both side I take the inverse all this. So, it will come this way now you see I have this if you consider the i th component of x n is non zero remaining element is how many components are there here x n n minus m out of this i th component of x n is non zero other is zero. So, if you multiply by b inverse d with x n agree if you multiply by this b x. So, first component of this one x n will multiply by first component of b inverse d plus second component of x n will multiplied by second component of b inverse d and so on. So, I have considered the i th component of what is called x n will be multiplied by i th component of b inverse d that component will be multiplied that will be non zero other remaining element will be column will be zero. So, I can write it now let us call i th component of i th component of b inverse d is equal to this small b into I am considering i th component of this one multiplied by x i agree this is this then what is this component will be there here x b plus is equal to b inverse b. So, this dimension if you see it is m cross 1 and this dimension is your m cross 1 this is 1 1 cross 1 by i th component this one. So, this is you can write it this v is what v is is the i th component i th column not component i th column i th column of b inverse d this. So, this is equation number we have come up to equation number 5 6 let us call up to 5 this is 6 this is the equation number 6. Now, we can write it see this one when this component will be zero when you see this i th component of i th column of b inverse d I am multiplied by x i because x i is non zero corresponding column of b inverse d is multiplied and this is b inverse capital b inverse b when this component this component that is it has a m components there out of m components out of m components you say which components because this x b components will be zero when this equal to this and how many components of this you have b you have a m components are there. So, it will be a this b 1 x i b inverse of b if this is equal to same x b you will zero now out of all this in which element of x b that basic variable will force it to make it zero agree that is our next question. So, let k th component of x b so how many components are there here m component out of this m th k th component of x b will drop to will drop to zero agree then from equation 6 from 6 what you can write it the k th component of this is assigned zero. So, we will write it b bracket x i b inverse of b agree I told you here I just mention it k th component of this this as a m variables are there out of m I am just considering k th component of x b is forcing to this zero. So, if it is a force is zero then this equal to this and that is also you have to consider k th component of b and here also you have to consider k th component of b inverse of b. So, that is why I am writing here the k th component and this is also k th component that this vector is you are having a m cross 1 column vector of m elements out of this that m th component I make it the x b m th component I am forces to the zero that means in other words that basic variable is entering as a non basic variable that x k th component x b I am assigning to zero. So, this equation then this equation must satisfy it. So, then I can write it x i is equal to is k th component of b inverse of b divided by k th component of b and this must be greater than equal to zero that is let us call equation number we have given six that is seven this is why it is greater than equal to zero because denominated part cannot be negative why it is greater than zero when you will compute the basic variables expression from here you see when you will compute the basic variable expression here this the k th component of this one I can write this k th component of this one minus if you take that side minus k th component of b k th component of b agree into x i into x i since x i value is greater than zero this that minus v i and x i this will be zero this will be zero provided v that this coefficient k th component of this one is positive. If k th component of this one is positive if you take that side it is a scalar quantity k th component of v is scalar quantity if it is a positive if you take that side it will be negative agree and then k x i is a your positive. So, this positive quantity minus whatever that this quantity this minus of this quantity it has a chance of making this is zero and if you if it is a negative this one agree if it is a negative of if the k th component is negative it goes to the net right hand side as a positive multiplied by positive quantity because x i is now is the basic variables. So, this added with the positive quantity agree. So, this value will increase we will not be able to force it to zero that one. So, that is why this is greater than zero this we have to consider the smallest. So, we have a such type of things there may be possibility we have a such type of x i choice m choices there out of this the smallest of this ratio will be treated as l b b living basic variable say x j. So, x j say x j. So, our new corner point or new vertex will be what at the new vertex new feasible solution you can say or new vertex or new corner point x i has become has become positive and as j has become zero agree with this choice. So, keeping all this thing in mind which we will say now how to solve this problems how to solve that our linear programming problem using the simplex algebraic approach simplex method using algebraic approach. So, we will take our earlier problems what we have discussed that minimize f of x is equal to x 1 x 2 plus 5 x 3 minus x 4 and subject to x 1 plus 2 x 3 plus 2 x 4 is equal to 6 and x 2 plus x 3 minus 2 x 4 is equal to 3. So, this is and your x i is greater than equal to 0 i is 1 2 3 4. So, if you recollect that last class we have just consider that problems this problem where x y x i x 2 x 3 x 4 is greater than equal to 0. That is we have considered last class that one agree and we have seen that which component we have to consider a non basic variable and basic variable to reduce the function value from previous point to new point the function value must reduce this one. Now, we will see that this algebraic approach how can be applied to solve this problems. So, first you identify the matrices A matrices and our other matrices. So, first is initialize initialize. So, see the our A matrix is that one quickly you can write it 1 0 2 2 that is 0 0 1 1 minus 2 and you can think of it this is the x 1 coefficient x 2 x 3 and this column when you think of it x 1 into 1 x 2 into 0 x 3 into 2 x 4 into 2 is equal to b, b matrix is your b vector is 6 3. Similarly, you can think x 1 into 0 x 2 into 1 x 3 into 1 this one plus x 4 into x is equal to 3 this. Now, our which one is our first iteration which one is our basic variables basic variable we will consider this one agree which are in the canonical form these are canonical form x 1 is involved in equation 1 x 2 is involved only equation 2. So, this 2 we can think of as a basic variables that are non basic variables are x 3 and x 4. So, we are now partition x 3 our x 1 x 2 our basic variables x 3 x 4 are our non basic variables. So, this is written as x b so x n agree and what is our c c transpose matrix you see 1 1 this. So, our c matrix is your if you see here 1 1 5 minus 1 and this corresponding to x 1 and this corresponding to x 2 this corresponds to x 3 x 4 this you can think of it x 1 into 1 plus x 2 into 1 x 3 into 5 this one x 4 into minus 1 is equal to our objective functions or cost function. So, if you see the c b this matrix corresponding to the basic variables and it is x 1 x 2 are the basic variables and this corresponding to our non basic variables x 3. So, this partition like this way and you know our c is what and b is what I can just partition now I can just partition like this way our b is your 1 0 0 1 b d is your 2 1 2 minus 1 agree this is our d. Similarly, we can see that our c b c b transpose is equal to 1 1 and c d transpose is equal to 5 minus 1. So, this we have been. Now, second step is checking the stopping criteria checking the stopping criteria again agree what is the stopping criteria how to check it that you have to find out the your r d what is called r d transpose the row vector this is a stopping criteria c. So, let us say our b d multiplied by x b and x n this value is non basic variable we have considered 0 is equal to 6 3 this one. So, our basic variables solution is x b is equal to 6 3. So, if you get any component of x b is negative this indicates that solution is not feasible because our problem was x is greater than equal to 0 this one. So, now let us say that our initial. So, we can write it now initial vertex or corner or initial feasible solution we got it vertex or corner is what x 1 is we got it that is x we got it 6 x 2 3 x 3 0 this we got it. Now, what is the cost function value cost function value is c transpose into x which is equal to c b transpose x c d x b c d transpose plus this is plus c d transpose x n agree. So, this value is 0 and this value c b transpose this into 6 1 into 6 plus 1 is c b value is c b transpose is 1 1 and this is c b is 6 3. So, if you do this one it is 9. So, our objective function value is at this point is 9 now we have to say whether we can if you move one of the non basic variable to basic variable and basic variable to one of the basic variable to non basic variable whether the function value can be reduced or not. So, now compute to know this one or to show this one compute r d transpose if you recollect this one we have derived r d transpose c transpose c d transpose minus c b transpose b inverse d. So, this equal to c d you know nothing but a 5 minus 1 minus c b you know it c b is 1 1 b transpose b I know is identity matrix agree. So, d is your 2 1 2 minus 2 see this is our d. So, if you compute that one ultimately you will get it here 2 minus 1 this. Now, you see r d measures that this coefficient because r d multiplied by what is this x n if you think of it is a multiplied by x n means x 3 x 4. So, it is multiplied by x 3 x 4 r d. So, there is a minus sign coefficient reduction coefficient. So, if you change x 4 value from 0 to some positive value there is a possibility of reduction in cost function below or x 3 is 0 I have not changed it. So, there is a possibility if you do this x 4 value you change it to non 0 values that means, some increasing value. So, x 4 will go act as a non basic variable and x 3 it will remain as a basic variable. So, I will stop it here today next class I will continue the remaining part of this problem.