190 likes | 429 Views
Assignment (6) Simplex Method for solving LP problems with two variables. 1- Introduction. Graphical method presented in last chapter is fine for 2 variables. But most LP problems are too complex for simple graphical procedures. The Simplex Method :
E N D
Assignment (6)Simplex Methodfor solving LP problems with two variables
1- Introduction • Graphical method presented in last chapter is fine for 2 variables. But most LP problems are too complex for simple graphical procedures. • The Simplex Method: • is appropriate for problems with more than 2 variables; • uses algebra rules, to find optimal solutions; • is an algorithm and is a series of steps that will accomplish a certain task. • In this chapter will introduce the simplex method for problems with 2 variables.
2- Simplex algorithm through an example: Assume one company producing flair furniture: Tables (T) and Chairs (C). The following table provides the information available:
Decision variables: • T = Number of tables • C = Number of chairs • Objective function: • Maximize Z = 7T + 5C • Constraints: • 2T + 1C 100 (Painting & varnishing) • 4T + 3C 240 (Carpentry) • T, C0 (non-negativity constraints) Formulation:
4T + 3C £ 240 100 £ Graphical method solution Optimal Solution: T=30, C=40 Z= 410 SR C 100 80 60 40 20 Number of Chairs 2T + 1C Feasible Region T 0 20 40 60 80 100 Number of Tables
1st Step: Built initial Simplex tableau • Less-than-or-equal-to constraints (≤) are converted to equations by adding a variable called “slack variable”. • Slack variables represent unused resources. • For the flair furniture problem, define the slacks as: • S1 = unused hours in the painting department • S2 = unused hours in the carpentry department • The constraints are now written as: • 2T + 1C + S1 = 100 • 4T + 3C + S2 = 240
1st Step, continued • Slack variables not appearing in an equation are added with a coefficient of 0.This allows all the variables to be monitored at all times. • The final Simplex equations appear as: • 2T + 1C + 1S1 + 0S2 = 100 • 4T + 3C + 0S1 + 1S2 = 240 • T, C, S1, S2 0 • The slacks are added to the objective coefficient with 0 profit coefficients. The objective function, then, is: Min. Z= -7T - 5C + 0S1 + 0S2
InitialSimplex tableau Non-Basic variables Basic variables We start by a basic solution Z=0.
2nd Step: Entering variable Choose one entering variable from non-basic variables (T or C) for which we have the largest negativecoefficient in the objective function. Here the entering variable will be T and the corresponding column is called pivot column. Pivot column
3rd Step: Leaving variable Choose one leaving variable from the basic variables (S1 or S2) for which we have the smallest value of quantities (Q) divided by items of pivot column: for S1 we have 100/2=50 for S2 we have 240/4=80 Then the leaving variable will be S1 and the corresponding row is called pivot row.
3rd Step: Leaving variable Pivot item Pivot row Pivot column
4th Step: Pivoting The pivoting is the changing of simplex tableau values as follow: • The entering variable (T) takes the place of leaving variable (S1). • All items of pivot column are =0 except pivot item =1. • All items of pivot row are divided by pivot item. • Other items of the tableau are calculated as follow: New A = A – B*C/D Pivot row Pivot column
4th Step: Pivoting The New value of the objective function is calculated as follow: Capacity of pivot row Z’ = Z + Largest coefficient * Pivot item If all coefficients of objective function are negatives or equal to zero the optimal solution is found. Otherwise go to step2.
4th Step: Pivoting Pivot item Pivot row Pivot column Pivoting
2nd Step: Entering variable The new largest negativecoefficient in the objective function is -3/2 then the entering variable will be C. 3rd Step: Leaving variable The new smallest value of quantities (Q) divided by items of pivot column is 40/1=40 then the leaving variable will be S2 .
4th Step: Pivoting Pivot item Pivot row Pivot column
4th Step: Pivoting All coefficients of objective function are now equal to zero. then the optimal solution is found: T=30, C=40; Z=410