The Simple Method Gauss-Jordan Elimination for Solving Linear Equations Eample: Gauss-Jordan Elimination Solve the following equations: + + + + = 4 = = () () () - In the first step of the procedure, we use the first equation to eliminate from the other two equations.
Gauss-Jordan Elimination - Such steps are called elementary row operations 5 + + + = 4 = 5 = () () () - In the second step of the procedure, we divide the second equation by -5 to make the coefficient of equal to. - Then, we use this equation to eliminate from equations and. This yields the following new system of equations: Gauss-Jordan Elimination + 7 / 5 / 5 / 5 = = = 0 () () () Finally, in he last step of the procedure, we use equation to eliminate in equations and. = = = 0 () () ()
Gauss-Jordan Elimination - linear systems of equations do not always have a unique solution and it is important to identify such situations. Eample Solve the following equations: + + = 4 + + = + + = - First we eliminate from equations and + + = 4 + + = = 6 () () () () () () Gauss-Jordan Elimination - Then we eliminate from equations and. 0 + = = = () () () - Equation shows that the linear system has no solution.
Eample + + Gauss-Jordan Elimination + + + Solve the following equations: = = + - Doing the same as above, we end up with: 0 + = = = 0 4 = 5 () () () () () () Gauss-Jordan Elimination - Now equation is an obvious equality. It can be discarded to obtain: = () = - The system has infinitely many solutions. + () It is generally true that a system of m linear equations in n variables has either: (a) No solution, (b) A unique solution, (c) Infinitely many solutions. 4
The Simple Method Simple method for solving linear programming is based fundamentally on the idea that the optimum solution is always associated with a corner point of the solution space. The simple method always starts at a feasible corner point of the feasible region, and always passes through an adjacent feasible corner point, checking each point for optimality before moving to a new one. Basically, this method gives a systematic way of moving from one corner to another one in the feasible region in such a way that the value of the objective function increases until an optimum value is reached or it is discovered that no solution eists. The Essence of The Simple Method - The four corner points are called corner-point feasible solutions. - The other five corner points are called corner-point infeasible solutions. 5
The Essence of The Simple Method Properties of the CPF solutions - If there is eactly one optimal solution, then it must be a CPF solution. - If there are multiple optimal solutions, then at least two must be adjacent CPF feasible solutions. - There are only a finite number of CPF solutions. - If a CPF solution has no adjacent CPF solution that are better as measured by the objective function, then there are no better CPF solutions anywhere; i.e., it is optimal. The Essence of The Simple Method The general structure of a simple method is as follow: 6
Setting Up The Simple Method The standard form to solve the simple method: - Where the objective is maimized, the constraints are equalities and the variables are all nonnegative. Setting Up The Simple Method If the problem is not in the standard form: - If the problem is min Z, convert it to ma - Z. - If a constraint is a i + a i +. + a in n b i, convert it into an equality constraint by adding a nonnegative slack variable s i. The resulting constraint is: a i + a i +. + a in n + s i = b i, where s i 0. - If a constraint is a i + a i +. + a in n b i, convert it into an equality constraint by subtracting a nonnegative surplus variable s i. The resulting constraint is: a i + a i +. + a in n - s i = b i, where s i 0. 7
If the problem is not in the standard form: If some variable j is unrestricted in sign, replace it everywhere in the formulation by j j, where j 0 and j 0. Eample Setting Up The Simple Method Transform the following linear program into standard form Minimize - + - + - + is unrestricted; 0; 0 Setting Up The Simple Method - Let us first turn the objective into a ma and the constraints into equalities. Maimize - - + + s = - + s = is unrestricted; 0; 0; s 0; s 0 - The last step is to convert the unrestricted variable into two nonnegative variables; where: =. 8
Setting Up The Simple Method - Then, the system of equations is transferred as follow: Maimize - - - - + + s = - + + - s = 0; 0; 0; 0; s 0; s 0 This form is called the augmented form Solution Using The Simple Method - Eample: Ma + (0) + 4 () + () 0; 0 Standard format: Ma + (0) + + s = 4 () + + s = () 0; 0 s 0; s 0 9
Solution Using The Simple Method - The augmented form: z - - = 0 Row ( 0) + + s = 4 Row () + + s = Row () The variables (other than the special variable z) which appear in only one equation are called basic variables. We solve these equation for the basic variables while assuming values for the non-basic variables (variables appeared in all equations). Initial basic feasible solutions: = = 0; s = 4; s = ; z = 0 Solution Using The Simple Method F E Z = 7/ D A B C Z = Z = 0 0
Solution Using The Simple Method - Optimality test - Rule : If all variables have a nonnegative coefficient in Row 0, the current basic feasible solution is optimal. Otherwise, pick a variable with a negative coefficient in Row 0. - Identify the entering basic variable (highest negative coefficient) - Identify where to stop - Leaving basic variable Solution Using The Simple Method - z - - = 0 - Entering Basic variable - So, setting = 0, yields the following solution = 0 s = 4 - s = - - Thus, can be increased just to, at which point s dropped to zero - s Leaving Basic variable
Solution Using The Simple Method - Solving for the new basic feasible solution - Increasing = 0 to = moves us from the initial basic feasible solution on the left to the new basic feasible solution on the right Initial New Non-basic variables: = 0, = 0 = 0, s = 0 Basic variable: s = 4, s = =, s =? Solution Using The Simple Method - Then, solve these equations for the basic variables and s z - - = 0 Row 0 + + s = 4 Row + + s = Row These yields z - ½ + ½s = Row 0 + ½ + ½s = Row / ½s + s = Row - With basic solution = s = 0; = ; s = ; z =
Solution Using The Simple Method F E Z = 7/ D A B C Z = Z = 0 Solution Using The Simple Method - Rule : For each Row i, i, where there is a strictly positive entering variable coefficient", compute the ratio of the Right Hand Side to the entering variable coefficient". Choose the pivot row as being the one with Minimum ratio - Optimality test - z - ½ + ½s = - Choose as entering basic variable, apply minimum ratio test: /(/) = 4 (row ); /(/) = / (row ), then s is the leaving variable
Solution Using The Simple Method - z - ½ + ½s = Row 0 + ½ + ½s = Row / ½s + s = Row - Thus yields; z + /s + /s = 7/ Row 0 + /s - /s = 5/ Row - /s + /s = / Row - With basic solution s = s = 0; = 5/; = /; z = 7/ The Simple Method in Tabular Format z - - = 0 + + s = 4 + + s = Coefficient of z s s z - - 0 0 0 Basic variables s 0 s 0 0 0 Right-hand side (solution) 4; 4/= ; /= 4
The Simple Method in Tabular Format New row = old row (pivot column coefficient new pivot row) Old row (z) ( - - 0 0 0) Pivot column coefficient - (0 ½ ½ 0 ) New row ( 0 -/ ½ 0 ) Basic variables Coefficient of Right-hand side z s s (solution) z - - 0 0 0 s s 0 0 0 0 4 z 0 -/ / 0 0 s 0 0 ½ / ½ -/ 0 ; /(/) = 4 ; /(/) = / The Simple Method in Tabular Format - All these calculation could be arranged as follow: 5
Eample on The Simple Method - A farmer owns a 00-acre farm and plans to plant at most three crops. The seed for crops A, B, and C costs LE 40, LE 0, and LE 0 per each acre, respectively. A maimum of LE 00 can be spent on seed. Crops A, B, and C require,, and work days per acre, respectively, and there are a maimum of 60 workdays available. If the farmer can make a profit LE 00 per acre on crop A, LE 00 per acre on crop B and LE 00 per acre on crop C, how many acres of each crop should be planted to maimize profit. Eample on The Simple Method Solution: - Decision Variables: - Let = number of acres of crop A. - Let = number of acres of crop B. - Let = number of acres of crop C. - Objective function: Maimize : Z= 00 + 00 + 00 6
Eample on The Simple Method - Subject to the constraints: + + 00 40 + 0 + 0 00 + + 60 0 ; 0 ; 0 Eample on The Simple Method The standard form: Z 00 00 00 = 0 + + + s = 00 40 + 0 + 0 + s = 00 + + + s = 60 0 ; 0 ; 0 ; s 0 ; s 0 ; s 0 7
The Simple Tableau Basic Variables Coefficient of Z s s s R.H.S Ratio Z -00-00 -00 0 0 0 0 R0 (objective) s 0 0 0 00 00 / = 00 R (constraint ) s 0 40 0 0 0 0 00 00 / 0 = 60 R (constraint ) s 0 0 0 60 60 / = 80 R (constraint ) Rn 0 0.5 0.5 0 0 0.5 80 The Simple Tableau Basic Variables Coefficient of Z s s s R.H.S Ratio Z 50 0-50 0 0 50 4000 R0n = (R0+00Rn) s 0 0.5 0 0.5 0-0.5 0 0 / 0.5 = 40 Rn = (R-Rn) s 0 0 0 0 0-0 600 600 / 0 = 80 Rn = (R-0Rn) 0 0.5 0.5 0 0 0.5 80 80 / 0.5 = 60 Rn = (0.5R) Rn 0 0 0-40 8
The Simple Tableau Basic Variables Coefficient of Z s s s R.H.S Z 00 0 0 00 0 00 6000 R0 = (R0n+50R) 0 0 0-40 R = (Rn) s 0 0 0 0-40 0 800 R = (Rn-0R) 0 0 0-0 60 R = (Rn-0.5R) = 0, = 60, = 40, s = 0, s = 800, s = 0, Z = LE 6000 Special Cases - Tie for the Entering Basic Variables : Maimize + 0 ; 0 + 4 + Standard form z - - = 0 + + s = 4 + + s = 0 ; 0 ; s 0 ; s 0 9
Special Cases - Tie for the Entering Basic Variables : - Start solution with any of or Special Cases - Alternate Optimal Solutions: Maimize + / + 4 + 0 ; 0 Standard form z - - / = 0 + + s = 4 + + s = 0 ; 0 ; s 0 ; s 0 0
Special Cases - Alternate Optimal Solutions: It is noted that the solution is finished but it may to get other optimal solution as follows: Special Cases - Alternate Optimal Solutions:
Special Cases - Degeneracy (Tie for the Leaving Basic Variable): Maimize + + 6-0 ; 0 Standard form z - = 0 + + s = 6 - + s = + s = 0 ; 0 ; s 0 ; s 0 ; s 0 Special Cases - Degeneracy (Tie for the Leaving Basic Variable): - Basic variables with a value of zero are called degenerate, and the same term is applied to same corresponding feasible solution
Special Cases - Degeneracy (Tie for the Leaving Basic Variable): Special Cases 4- Unbounded Optimum (No leaving basic variable): Maimize + - + 0 ; 0 Standard form z - = 0 - + + s = + s = 0 ; 0 ; s 0 ; s 0 ; s 0
Special Cases 4- Unbounded Optimum (No leaving basic variable): Special Cases 5- Infeasible solution: Maimize + + 4 + 0 ; 0 4
Special Cases 5- Infeasible solution: - It can be seen that infeasible solutions are characterized by the presence of at least one negative valued variable. Accordingly, any solution to a linear program is infeasible if any variable in the augmented form of a given problem is negative at that solution. Special Cases 6- Equality Constraints: Any equality can be substituted by two inequality constraints. For eample: a + a +.. + a n n = b is equivalent to: a + a +.. + a n n b and a + a +.. + a n n b Dealing with equality constraints will be discussed on the following eample. 5
Special Cases 6- Equality Constraints: Maimize + 5 4 + = 8 0 ; 0 The augmented form becomes z 5 = 0 + s = 4 + s = + = 8 0 ; 0 ; s 0 ; s 0 Special Cases 6- Equality Constraints: Equation does not have a basic variable. Accordingly, a nonnegative artificial variable is introduced as slack variable for Eq. (). Then, Eq. () becomes: + + s = 8 6
Special Cases 6- Equality Constraints: To bring s to zero, a huge number is multiplied by s and then subtracted from the objective function. Thus the objective function becomes: z = + 5 M s The added value "M" is called "the big M method". Then, maimum z occurs only when s = 0. When forming the simple tableau, it looks as follow: Special Cases 6- Equality Constraints: Equation (0) has two basic variables z and s. So, each basic variable should be eliminated from Eq. (0) ecept the "z". z ( + M) - (5 + M) = -8 M 7
6- Equality Constraints: Special Cases Special Cases 7- The Inequality Constraints Minimize Z = 0.4 + 0.5 Subject to 0. + 0..7 0.5 + 0.5 = 6 0.6 + 0.4 6 0 ; 0 0.6 + 0.4 6 Change to: 0.6 + 0.4 - s = 6 ( s 0 ) Then: 0.6 + 0.4 - s + s 4 = 6 ( s 0, s 4 0 ) 8
Special Cases 7- The Inequality Constraints Maimize - Z = - 0.4-0.5 Subject to 0. + 0. + s =.7 0.5 + 0.5 = 6 0.6 + 0.4 - s = 6 0 ; 0; s 0 ; s 0. Maimize - Z + 0.4 + 0.5 + M s + M s 4 = 0 Subject to 0. + 0. + s =.7 0.5 + 0.5 + s = 6 0.6 + 0.4 - s + s 4 = 6 0 ; 0; s 0 ; s 0; s 4 0. Special Cases 7- The Inequality Constraints Equation (0) has three basic variables z, s, and s 4. So, each basic variable should be eliminated from Eq. (0) ecept the "z". To eliminate s and s 4 from Eq. (0), subtract M times Eqs. () and () from Eq. (0), thus yields: -Z + (0.4. M) + (0.5 0.9 M) + M s = - M 9
Special Cases 7- The Inequality Constraints Then, the resulting initial simple tableau as follow: Then, applying the simple method as usual as presented: Special Cases 7- The Inequality Constraints 0
Sensitivity Analysis - The sensitivity analysis measures how sensitive is the optimal solution to the change in the resources values (right hand side of the constraints), i.e., by changing the resource limits, would the optimal solution be changed and to what limit. This is called right hand side sensitivity analysis. Also, it measures the sensitivity of an optimal solution to changes in the values of the coefficients that multiply the decision variables in the objective function. This is called objective function sensitivity analysis. Sensitivity Analysis Right-Hand Side Sensitivity Maimize Z = 40 + 60 Subject to: + 4 8 5 + 5 50 8 6 0 ; 0
Sensitivity Analysis Right-Hand Side Sensitivity Sensitivity Analysis Objective Function Sensitivity