Simplex Method
Simplex Method
Aakash
Ayush
Gopal
Nimeshee
Slack Variables
A mathematical representation of surplus
resources. In real life problems, its unlikely
that all resources will be used completely,
so there usually are unused resources.
Slack variables represent the unused
resources between the left-hand side and
right-hand side of each inequality.
32
3x1 4 x2 s2 84
This system has two equations, we can select any two of the four
variables as basic variables. The remaining two variables are
then non-basic variables. A solution found by setting the two
non-basic variables equal to 0 and solving for the two basic
variables is a basic solution. If a basic solution has no
negative values, it is a basic feasible solution.
Pivot
Pivot Column: The column of the tableau
representing the variable to be entered
into the solution mix.
Pivot Row: The row of the tableau
representing the variable to be replaced in
the solution mix.
Pivot Number: The element in both the pivot
column and the pivot row.
Example
maximize 3x + 5y
subject to
x+ y4
x + 3y 6
x0, y0
maximize 3x + 5y + 0u + 0v
subject to
x+ y+ u
=4
x + 3y +
v =6
x0, y0, u0, v0
Initial tableau
Entering
variable
2. Initial tableau
Basic
variable
X1
X2
S1
S2
S3
RHS
S1
S2
12
S3
18
-3
-5
Leaving
variable
Pivot column
Pivot row
Pivot
number
Simplex tableau
Notes:
The basic feasible solution at the initial
tableau is (0, 0, 4, 12, 18) where:
X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z
=0
Where S1, S2, and S3 are basic variables
X1 and X2 are nonbasic variables
Constraint type
Variable to be added
+ slack (s)
+ Artificial (A)
Xn S1
... Sn A1 . An
RHS
b1
bm
Objective function coefficient
In different signs
Z
value
1.
2.
3.
the row with the smallest -ratio, mark this row to indicate the
departing variable and the pivot row.
Step 4 [Form the next tableau]
Divide all the entries in the pivot row by its entry in the pivot column.
Subtract from each of the other rows, including the objective row, the
new pivot row multiplied by the entry in the pivot column of the row in
question.
Replace the label of the pivot row by the variable's name of the pivot
column and go back to Step 1.
17
maximize
z = 3x + 5y + 0u + 0v
subject to
x+ y+ u
=4
x + 3y
+ v =6
x0, y0, u0, v0
x
2
3
1
3
1
3
1
3
4
3
5
3
10
3/2
1/3
1/2
1/2
14
18
EXAMPLE
The Cannon Hill furniture Company produces
tables and chairs. Each table takes four hours of
labor from the carpentry department and two
hours of labor from the finishing department. Each
chair requires three hours of carpentry and one
hour of finishing. During the current week, 240
hours of carpentry time are available and 100
hours of finishing time. Each table produced gives
a profit of $70 and each chair a profit of $50. How
many chairs and tables should be made?
or
4 x1 3x2 s1 0 s2 240
2 x1 x2 0s1 s2 100
P 70 x1 50 x2 0s1 0s2 0
STEP 2
Basic
Variable
s
x1
x2
S1
S2
Right
Hand
Side
S1
240
S2
100
-70
-50
x1 0, x2 0, s1 240, s2 100, P 0
The slack variables S1 and S2 form the initial solution mix. The initial
solution assumes that all avaliable hours are unused. i.e. The slack variables
take the largest possible values.
STEP 3
Select the pivot column (determine which variable to enter into
the solution mix). Choose the column with the most
negative element in the objective function row.
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
S1
240
S2
100
-70
-50
Pivot column
STEP 4
No, There arent any positive elements in
the pivot column above the dashed line.
We can go on step 5
STEP 5
Select the pivot row (determine which variable to replace in the
solution mix). Divide the last element in each row by the
corresponding element in the pivot column. The pivot row is the row
with the smallest non-negative result.
Enter
Exit
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
S1
240
240 / 4 60
S2
100
100 / 2 50
-70
-50
Pivot number
Pivot column
Pivot row
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
S1
240
x1
1/2
1/2
50
-70
-50
R2
2
Use row operations to make all numbers in the pivot column equal to 0 except
for the pivot number which remains as 1.
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
S1
-2
40
x1
1/2
1/2
50
-15
35
3500
4.R2 R1
70.R2 R3
If 50 tables are made, then the unused carpentry hours are reduced by 200
hours (4 h/table multiplied by 50 tables); the value changes from 240 hours to 40
hours. Making 50 tables results in the profit being increased by $3500; the value
changes from $0 to $3500.
In this case,
x1 50, x2 0, s1 40, s2 0, P 3500
Now repeat the steps until there are no negative numbers in the last row.
Select the new pivot column. x2 should enter into the solution mix.
Select the new pivot row. S1 should be replaced by x2 in the solution mix.
Enter
Exit
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
S1
-2
40
40 /1 40
x1
1/2
1/2
50
50 / 0,5 100
-15
35
3500
New pivot row
New pivot
column
Calculate new values for the pivot row. As the pivot number is already 1,
there is no need to calculate new values for the pivot row.
Use row operations to make all numbers in the pivot column equal to
except for the pivot number.
Basic
Variable
s
x1
x2
S1
S2
Right
hand
side
x2
-2
40
x1
-1/2
3/2
30
1
.R1 R2
2
15
4100
15.R1 R3
Result
This simplex tableau represents the optimal
solution to the LP problem and is interpreted as:
x1 30,
x2 40,
s1 0,
s2 0
Improvements
34