Você está na página 1de 25

LINEAR PROGRAMMING : THE SIMPLEX METHOD

2
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

INTRODUCTION
Most real-life LP problems have more than two variables and are thus too large for simple graphical solution procedure. How does the simplex method work? In LP problems containing several variables, we may not be able to graph the feasible region, but the optimal solution will still lie at a corner point of the many-sided, many-dimensional figure (n-dimensional polyhedron) that represents the area of feasible solutions. The simplex method examines the corner points in an iterative manner (repeating the same set of procedures time after time until an optimal solution is reached). Each iteration brings a higher value for the objective function so that we are always moving closer to the optimal solution. Why should we study the simplex method? The simplex approach yields not only the optimal solution to the Xi variables and the maximum profit (or minimum cost), but valuable economic information as well.

3
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

THE SIMPLEX METHOD


General steps: 1. The process starts at the origin (i.e., the initial solution is defined as X1 = 0 and X2 = 0.) 2. After the initial solution is selected, the simplex process searches for a better solution (if one exists), i.e., one with a higher Z value. When a better solution is found, the simplex procedure automatically eliminates all other solutions that are not as good. 3. This process is repeated until a better solution cannot be found. The simplex process then terminates and the optimal solution is indicated.

4
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

HOW TO SET UP THE INITIAL SIMPLEX SOLUTION


Using the case of the Flair Furniture Co. as example: Let T = number of tables produced C = number of chairs produced Objective : To maximize profit = $7T + $5C Subject to: 2T + 1C 100 painting hours 4T + 3C 240 carpentry hours T, C 0 nonnegativity

5
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Converting the Constraints to Equations


Convert each inequality constraint (except nonnegativity constraints) into an equation by adding a slack variable (which represents unused resources) to each constraint. The simplex is a matrix algebra method that requires all mathematical relationships to be equations, with each equation containing all of the variables. Example: S1 = Slack variable representing unused hours in the painting department S2 = Slack variable representing unused hours in the carpentry department So, the constraints now become 2T + 1C + S1 = 100 4T + 3C + S2 = 240 Thus, if the production of tables (T) and chairs ( C ) uses less than 100 hours of painting time available, the unused time is the value of the slack variable, S1.

6
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Converting the Constraints to Equations (cont.)


To include all variables in each equation, slack variables not appearing in an equation are added with a coefficient of 0. The equations now become: 2T + 1C + 1S1 + 0S2 = 100 4T + 3C + 0S1 + 1S2 = 240 T, C, S1, S2 0 And the objective function becomes Maximize profit = $7T + $5C +$0S1 + $0S2

7
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

The First Simplex tableau


Constraint Equations
SOLUTION MIX S1 T 2 C 1 S1 1 S2 0 QUANTITY (RIGHT-HAND SIDE) 100

S2

240

Basic variables variables in the solution mix. Nonbasic variables those not in the solution mix.

8
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

THE GENERAL SIMPLEX TABLEAU


Cj Basis C1 X1 C2 X2 C3 S1 C4 S2 Quantity

Zj Cj - Zj

9
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

THE GENERAL SIMPLEX TABLEAU (cont.)

Cj (row) = The profit or cost coefficients of the objective function; c1, c2, c3, c4. Cj (column) = The profit or cost coefficients of the objective function for solution variables in the basis. Basis = The variables currently in the solution set, i.e., the variables that have values at the present solution point being analyzed (basic feasible solution). Quantity = Initially, these are the values on the right-hand side of the problem constraints; as the simplex method iterates toward a solution, these values are the solution values for corresponding variables in the solution basis. Zj = Total contribution (gross profit) of the given solution. Cj Zj = The net profit from introducing one unit of each variable into the solution. Note: The initial solution is always the solution at the origin. The number of basic variables corresponds to the number of constraint equations in the problem (excluding the nonnegativity constraints). An optimal solution is reached in the simplex method when the Cj Zj row contains no positive numbers.

10
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Example
Objective: Maximize profit, Z = $7T + $5C +$0S1 + $0S2 Subject to: Painting hours constraint: 2T + 1C + 1S1 + 0S2 = 100 Carpentry hours constraint: 4T + 3C + 0S1 + 1S2 = 240 Nonnegativity constraint: T, C, S1, S2 0

11
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

The Initial Simplex Tableau


Cj 0 0 Basis S1 S2 Zj Cj - Zj 7 T 2 4 0 7 5 C 1 3 0 5 0 S1 1 0 0 0 0 S2 0 1 0 0 Quantity 100 240 0

12
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

SIMPLEX SOLUTION PROCEDURES - Five Steps of the Simplex Method for Maximization Problems
1. Determine which variable to enter the solution mix next. Variable entering the solution has the largest positive Cj - Zj. The column for the variable identified is called the pivot column.

Example: The column with the largest positive number (7) in the Cj - Zj row is the column for the variable T. So, this is the pivot column.

13
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Step 2
2. Determine which variable to replace. Divide each amount in the Quantity column by the corresponding number in the column selected in step 1. The row with the smallest nonnegative number calculated this way will be replaced in the next tableau. This is the pivot row. The number at the intersection of the pivot row and pivot column is called the pivot number. Example: For the S1 row: For the S2 row: 100/2 = 50 tables 240/4 = 60 tables

Since 50 is less than 60, S1 will be replaced in the next tableau by T. So, S1 row will be the pivot row. (50 indicates the maximum number of units of T that can be produced without violating either of the original constraints. When T = 50, S1 = 0). The pivot number is 2.

14
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Step 3
3. Compute new values for the pivot row. Divide every number in the pivot row by the pivot number. Example: 2/2 = 1 = =
Cj 7 Basis T T 1 C 1/2

0/2 = 0 100/2 = 50
S1 1/2 S2 0 Quantity 50

15
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Step 4
4. Compute the new values for each remaining row. (optional) (new row numbers) = (number in old row) (number above or below pivot number) x (corresponding number in the new row, i.e., the row replaced in step 3). Example: Number in New S2 Row = Number in Old S2 Row (Number Below Pivot Number ) X (Corresponding Number in the New T Row)
Number in New S2 Row 0 = Number in Old S2 Row 4 (Number Below X (Corres. No. in Pivot Number ) New T Row) 4 1

16
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Step 5
5. Compute the Zj and Cj Zj rows. If all numbers in the Cj Zj row are 0 or negative, an optimal solution has been reached. If not, return to step 1.

17
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

The Second Simplex Tableau for Flair Furniture:


Cj 7 0 Basis T S2 Zj Cj - Zj 7 T 1 0 7 0 5 C 1/2 1 7/2 3/2 0 S1 1/2 -2 7/2 -7/2 0 S2 0 1 0 0 Quantity 50 40 350

It means that, given the current solution, the net profit of one more unit of C is RM1.50. Pivot column : C Pivot row: S2 Pivot number: 1

18
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

The Final Simplex Tableau for Flair Furniture:


Cj

7 5

Basis T C Zj Cj - Zj

7 T 1 0 7 0

5 C 0 1 5 0

0 S1 3/2 -2 1/2 -1/2

0 S2 -1/2 1 3/2 -3/2

Quantity 30 40 410

Since every number in the Cj Zj row is 0 or negative, an optimal solution has been reached. Thus the solution is: T = 30 tables C = 40 chairs S1 = 0 slack hours in the painting dept. S2 = 0 slack hours in the carpentry dept. Profit = $410 for the optimal solution.

19
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Surplus And Artificial Variables


Minimization problem (constraints with greater-than-or-equal inequalities) Constraints with inequalities, minus surplus variable (S), plus artificial variable (A) Constraints with equation, plus artificial variable (A) Eg: Minimize cost = 5X1 + 9X2 + 7X3 Subject to : X1 + 10X2 + 8X3 210 25X1 + 30X2 = 900 Rewrite constraints 5X1 + 10X2 +8X3 S1 + A1 = 210 25X1 + 30X2 + A2 = 900

20
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Surplus And Artificial Variables (cont.)


Complete objective and constraints Minimize cost = 5X1 + 9X2 + 7X3 + 0S1 + MA1 + MA2 Subject to : 5X1 + 10X2 + 8X3 1S1 + 1A1 + 0A2 = 210 25X1 + 30X2 + 0X3 + 0S1 + 0A1 + 1A2 = 900 (M represent a very large amount/value)

21
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Solving Minimization Problem


1. Choose the variable with the greatest negative Cj - Zj to enter the solution. 2. Determine the row to be replaced by selecting that one with the smallest (non-negative) quantity-to-pivot-column ratio. 3. Calculate the new values for the pivot row. 4. Calculate the new values for the other row(s). 5. Calculate the Cj and Cj - Zj values for this tableau. If there are any Cj - Zj values less than zero, return to Step 1.

22
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Special Cases (Infeasibility)


Cj 5 8 0 Solution X1 X2 S1 Mix
X1 X2 A2 Zj Cj-Zj 1 0 0 5 0 0 -2 1 0 0 1 0

0 S2
3 2 -1

M A1
-1 -2 -1

M A2
0 0 1 0

Qty
200 100 20

5 8 M

8 -2 31-M -21-M 2 M-31 2M+21

M 1800+20M

23
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

24
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

EXERCISE

25
LP: SIMPLEX NORSHAIEDA ABDULLAH Jumaat, 14 Februari 2014

Você também pode gostar