510 likes | 699 Views
ME 443 . LINEAR PROGRAMMING Prof. Dr. Mustafa Gökler. SIMPLEX METHOD. Linear programming (LP) finds a vast area of application in production management problems. The simplex method is one of the LP method used.
E N D
ME 443 LINEAR PROGRAMMING Prof. Dr. Mustafa Gökler
SIMPLEX METHOD Linear programming (LP) finds a vast area of application in production management problems. The simplex method is one of the LP method used. The simplex method involves the manipulation of a set of simultaneous linear equations. In general, algebraic solution of these simultaneous equations is impossible, because they contain more unknowns than there are equations.
SIMPLEX METHOD This means that many possible values exist for the unknown quantities which would satisfy the equation. In most cases an infinite number of solutions to the simultaneous equations exist. The simplex method consist of a series manipulations in which one of the equations, the objective function, is optimized that is, minimized or maximized. In order to optimize the objective function, the restrictions are manipulated.
SIMPLEX METHOD There are two types of problems: 1. MAXIMIZATION PROBLEMS (e.g. profit maximization, volume maximization) 2. MINIMIZATION PROBLEMS (e.g. cost minimization, weight minimization)
PROFIT MAXIMIZATION ILLUSTRATIVE EXAMPLE * One machine has twelve hours and a second machine has eight hours of excess capacity. * The firm manufactures products A and B. * Each unit of product A requires two hours of time on both machines. * Each unit of product B, on the other hand, requires three of time on the first machine and one hour on the second machine.
PROFIT MAXIMIZATION * The incremental profit is 600 TL per unit of A and 700 TL per unit of B, and the firm can sell as many of either product as it can manufacture. * Assuming the objective is to maximize profit, how many units of product a and product B should be produced?
FORMULATING OF PROBLEM x1 = The number of units of product A to be produced x2 = The number of units of product B to be produced P = The incremental profit Then the objective function we are going to maximize is P = 600 x1 + 700 x2
FORMULATING OF PROBLEM Maximize: P = 600 x1 + 700 x2 Subject to : 2x1 + 3x2< 12 2x1 + x2< 8 x1> 0 x2> 0 It should be noted that the best product mix may not use all the capacity which is available.
Converting the inequalities to equalities • Introduce slack variables x3 and x4 • x3 and x4may be zero or greater than zero • 2x1 + 3x2< 12 2x1 + 3x2 + x3 = 12 2x1 + x2< 8 2x1 + x2 + x4 = 8 • 2x1 + 3x2 + x3 + 0x4 = 12 • 2x1 + x2 +0 x3 + x4 = 8
OBJECTIVE FUNCTION The profit function becomes: P = 600 x1 + 700x2 + 0x3 + 0x4 2x1 + 3x2 + x3 + 0x4 = 12 2x1 + x2 +0 x3 + x4 = 8
FIRST SIMPLEX TABLE • ____________________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ___________________________________________________ • 0 x3 12 1 0 2 3 • 0 x4 8 0 1 2 1 __________________________________________________
FIRST SIMPLEX TABLE • ______________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ______________________________________________ • 0 x3 12 1 0 2 3 • 0 x4 8 0 1 2 1 _____________________________________________ • zi 0 0 0 0 0 • ci-zi 0 0 600 700 ____________________________________________
WHICH ROW WILL BE REPLACED ? In max. problems, the maximum positive value of ci-zi shows the which column replaces x3 rowor x4 row Therefore x2 will replace x3 rowor x4 row __________________________________________ P0 /(Intersection value of Row and Colomn) For x3 12/3=4 For x4 8/1=8 The smallest positive value indicates which row is replaced. Therefore, x3 will be replaced by x2
NEW ROW VALUES Values of new x2 Row = (Old x3 Row)/(Intersection value of x3 Row and x2 Column) Values of new x4 Row = Old x4 Row - (Intersection value of x4 Row and x2 Column)X (new x2 Row)
SECOND SİMPLEX TABLE • ____________________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ___________________________________________________ • 700 x2 4 1/3 0 2/3 1 • 0 x44 - 1/3 1 4/3 0 • __________________________________________________
SECOND SİMPLEX TABLE • ____________________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ___________________________________________________ • 700 x2 4 1/3 0 2/3 1 • 0 x44 - 1/3 1 4/3 0 • __________________________________________________ • zi 2800 700/3 0 1400/3 700 • ci – zi - 700/3 0 400/3 0 • __________________________________________________
WHICH ROW WILL BE REPLACED ? In Max. Problem, the maximum positive value of ci-zi shows the which column replaces x2 rowor x4 row. Therefore x1 will replace x2 rowor x4 row ________________________________________ P0 /(Intersection value of Row and Colomn) For x2 4/(2/3)=6 For x4 4/(4/3)=3 The smallest positive value indicates which row is replaced. Therefore, x4 will be replaced by x1
NEW ROW VALUES Values of new x1 Row = (Old x4 Row)/(Intersection value of x4 Row and x1 Column) Values of new x2 Row = Old x2 Row - (Intersection value of x2 Row and x1 Column)X (new x1 Row)
THIRD SİMPLEX TABLE • ____________________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ___________________________________________________ • 700 x2 2 1/2 - 1/2 0 1 • 600 x1 3 - 1/4 3/4 1 0 • __________________________________________________
THIRD SİMPLEX TABLE • ____________________________________________________ • Ci 0 0 600 700 • Sol. Mix Po x3 x4 x1 x2 • ___________________________________________________ • 700 x2 2 1/2 - 1/2 0 1 • 600 x1 3 - 1/4 3/4 1 0 • __________________________________________________ • zi 3200 200 100 600 700 • ci – zi - 200 - 100 0 0 • __________________________________________________
OPTIMUM SOLUTION x1 = 3 x2 = 2 P= 3200 x3 = 0 x4 = 0 ___________________________ Maximize: P = 600 x1 + 700 x2 Subject to : 2x1 + 3x2< 12 2x1 + x2< 8 x1> 0 x2> 0
COST MINIMIZATION ILLUSTRATIVE EXAMPLE A certain product has a specification that it must weigh 150 kg. The two row materials used are A, with a cost of 200 TL per unit, and B, with a cost of 800 TL per unit. At least 14 units of B and no more than 80 units of A must be used. Each unit of A weighs 5 kg; Each unit of B weighs 10 kg. How much of each type of raw material should be used for each unit of final product if we wish to minimize cost ?
EXAMPLE Objective Function : Minimize C = 200 x1 + 800 x2 Where x1 = The number of units of product A X2 = The number of units of product B C = Cost
EXAMPLE The restraints (constraints) can be stated in the following way: 5x1 + 10x2 = 150 x1< 20 x2> 14 x1> 0
CONSTRAINTS AND VARIABLES constraintsVariable Used in Equalities ……..< K => Positive slack ……...= K => Artificial variable .…….> K => Artificial variable and Negative slack Coeffient in front of artificial Problem variable in Objective Function Maximization -M Minimization +M (M is very large number)
EXP(MIN.) 5x1 + 10x2 + x3 + 0x4 + 0x5 + 0x6 = 150 x1 + 0x2 + 0x3 + x4 + 0x5 + 0x6 = 20 0x1 + x2 + 0x3 + 0x4 – x5 + x6 = 14 The cost function is: C = 200x1 + 800x2 + Mx3 + 0x4 + 0x5 + Mx6
FIRST SIMPLEX TABLE _________________________________________________________ Ci M 0 M 200 800 0 Sol. Mix P0 x3 x4 x6 x1 x2 x5 ________________________________________________________ M x3 150 1 0 0 5 10 0 0 x4 20 0 1 0 1 0 0 M x6 14 0 0 1 0 1 -1 ________________________________________________________ zi 164M M 0 M 5M 11M -M ci – zi 0 0 0 200-5M 800-11M M ________________________________________________________
WHICH ROW WILL BE REPLACED ? In min. problems, the maximum negative value of ci-zi shows the which column replaces x3 or x4 or x6 row Therefore x2 will replace x3 or x4 or x6 __________________________________________ P0 /(Intersection value of Row and Colomn) For x3 150/10=15 ; For x4 20/0=undefined For x6 14/1=14 The smallest positive value indicates which row is replaced. Therefore, x6 will be replaced by x2
NEW ROW VALUES Values of new x2 Row = (Old x6 Row)/(Intersection value of x6 Row and x2 Column) Values of new x3 Row = Old x3 Row - (Intersection value of x3 Row and x2 Column)X (new x2 Row) Values of new x4 Row = Old x4 Row - (Intersection value of x4 Row and x2 Column)X (new x2 Row)
SECOND SIMPLEX TABLE _________________________________________________________ Ci M 0 M 200 800 0 Sol. Mix P0 x3 x4 x6 x1 x2 x5 ________________________________________________________ M x3 10 1 0 -10 5 0 10 0 x4 20 0 1 0 1 0 0 800 x2 14 0 0 1 0 1 -1 ________________________________________________________ zi 10M+11200 M 0 -10M+800 5M 800 10M-800 ci – zi 0 0 11M-800 200-5M 0 -10M+800 ________________________________________________________
WHICH ROW WILL BE REPLACED ? In min. problems, the maximum negative value of ci-zi shows the which column replaces x3 or x4 or x2 row Therefore x5 will replace x3 or x4 or x2 __________________________________________ P0 /(Intersection value of Row and Colomn) For x3 10/10=1 ; For x4 20/0=undefined For x2 14/-1= -14 The smallest positive value indicates which row is replaced. Therefore, x3 will be replaced by x5
NEW ROW VALUES Values of new x5 Row = (Old x3 Row)/(Intersection value of x3 Row and x5 Column) Values of new x4 Row = Old x4 Row - (Intersection value of x4 Row and x5 Column)X (new x5 Row) Values of new x2 Row = Old x2 Row - (Intersection value of x2 Row and x5 Column)X (new x5 Row)
THIRD SIMPLEX TABLE _________________________________________________________ Ci M 0 M 200 800 0 Sol. Mix P0 x3 x4 x6 x1 x2 x5 ________________________________________________________ 0 x5 1 1/10 0 -1 1/2 0 1 0 x4 20 0 1 0 1 0 0 800 x2 15 1/10 0 0 1/2 1 0 ________________________________________________________ zi 12000 80 0 0 400 800 0 ci – zi M-80 0 M -200 0 0 ________________________________________________________
WHICH ROW WILL BE REPLACED ? In min. problems, the maximum negative value of ci-zi shows the which column replaces x5 or x4 or x2 row Therefore x1 will replace x5 or x4 or x2 __________________________________________ P0 /(Intersection value of Row and Colomn) For x5 1/(1/2)=2 ; For x4 20/1=20 For x2 15/(1/2))= 30 The smallest positive value indicates which row is replaced. Therefore, x5 will be repaced by x1
NEW ROW VALUES Values of new x1 Row = (Old x5 Row)/(Intersection value of x5 Row and x1 Column) Values of new x4 Row = Old x4 Row - (Intersection value of x4 Row and x1 Column)X (new x1 Row) Values of new x2 Row = Old x2 Row - (Intersection value of x2 Row and x1 Column)X (new x1 Row)
FOURTH SIMPLEX TABLE _________________________________________________________ Ci M 0 M 200 800 0 Sol. Mix P0 x3 x4 x6 x1 x2 x5 ________________________________________________________ 200 x1 2 1/5 0 -2 1 0 2 0 x4 18 -1/5 1 2 0 0 -2 800 x2 14 0 0 1 0 1 -1 ________________________________________________________ zi 11600 40 0 400 200 800 -400 ci – zi M- 40 0 M- 400 0 0 400 ________________________________________________________
OPTIMUM SOLUTION x1 = 2 x2 = 14 C= 11600 x3 = 0 x4 = 18 x5 = 0 __________________________ Minimize C = 200 x1 + 800 x2 5x1 + 10x2 = 150 x1< 20 x2> 14 x1> 0
NO UNIQUE SOLUTION Under certain situations, it is possible that the linear programming problem does not have a unique solution. For example, assume that the third simplex table appears for a minimization problem as shown in the next table;
NO UNIQUE SOLUTION _________________________________________________________ Ci M 0 M -1600 800 0 Sol. Mix P0 x3 x4 x6 x1 x2 x5 ________________________________________________________ 0 x5 1 1/10 0 -1 -1/2 0 1 0 x4 20 0 1 0 -1 0 0 800 x2 15 1/10 0 0 -1/2 1 0 ________________________________________________________ zi 12000 80 0 0 -400 800 0 ci – zi M-80 0 M -1200 0 0 ________________________________________________________
NO UNIQUE SOLUTION In min. problems, the maximum negative value of ci-zi shows the which column replaces x5 or x4 or x2 row Therefore x1 will replace x5 or x4 or x2 P0 /(Intersection value of Row and Colomn) For x5 1/(-1/2)= -2 ; For x4 20/-1=-20 For x2 15/(-1/2))= -30 All of them are negative.There is no restriction on x1. If the above situation develops, the cause will be a mistaked restraint. Business situations properly described will not usually result in a non-solvable table.
DEGENERACY A solution known as a degenerate solution may develop when one of the restraints is redundant. For example, x1> 16 and x1> 30 => x1> 16 is redundant. However, most redundant restraints will not be as easily recognized as above.
DEGENERACY ILLUSTRATIVE EXAMPLE Maximize: P = 400 x1 + 300 x2 Subject to : 4x1 + 2x2< 10 2x1 + 8/3x2< 8 x1> 0 x2> 1.8
DEGENERACY 4X1 + 2X2 + X3 + 0X4 + 0X5 + 0X6 = 10.0 2X1 + 8/3X2 + 0X3 + X4 + 0X5 + 0X6 = 8.0 0X1 + X2 + 0X3 + 0X4 + X5 – X6 = 1.8 The objective function is: P = 400x1 + 300x2 + 0x3 + 0x4 -Mx5 + 0x6
FIRST SIMPLEX TABLE _______________________________________________________ Ci 0 0 -M 400 300 0 Sol.Mix P0 x3 x4 x5 x1 x2 x6 _______________________________________________________ 0 x3 10 1 0 0 4 2 0 0 x4 8 0 1 0 2 8/3 0 -M x5 1.8 0 0 1 0 1 - 1 _________________________________________________________ zi -1.8M 0 0 -M 0 -M M ci – zi 0 0 0 400 300+M -M _________________________________________________________
SECOND SIMPLEX TABLE ______________________________________________________ Ci 0 0 -M 400 300 0 Sol.Mix P0 x3 x4 x5x1 x2 x6 ______________________________________________________ 0 x3 6.4 1 0 -2 4 0 2 0 x4 3.2 0 1 -8/3 2 0 8/3 300 x2 1.8 0 0 1 0 1 -1 ______________________________________________________ zi 540 0 0 300 0 300 -300 ci – zi 0 0 -M-300 400 0 300 ______________________________________________________
DEGENERACY P0 /(Intersection value of Row and Colomn) For row x3 6.4/4=1.6 For row x4 3.2/2=1.6 For row x2 1.8/0=undefined Therefore, degeneracy situation occurs. Fortunately, the simplex procedure will generally give the correct answer, if we choose either of two rows and later choose the other row if the first choice does not give a solution.
THIRD SIMPLEX TABLE(ALT. 1) ______________________________________________________ Ci 0 0 -M 400 300 0 Sol.Mix P0 x3 x4 x5x1 x2 x6 ______________________________________________________ 0 x3 0 1 -2 10/3 0 0 -10/3 400 x1 1.6 0 1/2 -4/3 1 0 4/3 300 x2 1.8 0 0 1 0 1 -1 ______________________________________________________ zi 1180 0 200 -700/3 400 300 700/3 ci – zi 0 -200 -M+700/3 0 0 -700/3 _____________________________________________________
THIRD SIMPLEX TABLE(ALT. 2) ______________________________________________________ Ci 0 0 -M 400 300 0 Sol.Mix P0 x3 x4 x5x1 x2 x6 ______________________________________________________ 400 x1 1.6 1/4 0 -1/2 1 0 1/2 0 x4 0 -1/2 1 -5/3 0 0 5/3 300 x2 1.8 0 0 1 0 1 -1 ______________________________________________________ zi 1180 100 0 100 400 300 -100 ci – zi -100 0 -M-100 0 0 100 ___________________________________________________
FOURTH SIMPLEX TABLE(ALT. 2) ______________________________________________________ Ci 0 0 -M 400 300 0 Sol.Mix P0 x3 x4 x5x1 x2 x6 ______________________________________________________ 400 x1 1.6 2/5 -3/10 0 1 0 0 0 x6 0 -3/10 3/5 -1 0 0 1 300 x2 1.8 -3/10 3/5 0 0 1 0 ______________________________________________________ zi 1180 70 60 0 400 300 0 ci – zi -70 -60 -M 0 0 0 ___________________________________________________
DEGENERACY Maximize: P = 400 x1 + 300 x2 Subject to : 4x1 + 2x2< 10 2x1 + 8/3x2< 8 x1> 0 x2> 1.8 x1 = 1.6 x2 = 1.8 x3 = 0 x4 = 0 x5 = 0 x6 = 0 P= 1180 The number of other than the xi> 0 constraints is 3, and the optimum solution has 2 nonzero variables.