Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Cycling in Simplex

Method

Aryaman Banga
Karan Kukreja
Let’s start
with an
example: Note: We have added
Min slack variables s1, s2, and s3
• z = -10x1+ 57x2 + 9x3 + 24x4 to convert (1), (2) and (3)
subject to: inequalities to equality
equations.
1) 1/2x1 – 11/2x2 – 5/2x3 + 9x4 0
2) 1/2x1 – 3/2x2 – 1/2x3 + x4 0 Initial basic feasible solution
is given by z = 0 where s1= 0,
3) x1 + x2 + x3 + x4 1
s2 = 0 and s3 = 1
4) x1, x2, x3, x4 0 Iteration 1 = T1
z x1 x2 x3 x4 s1 s2 s3 b
z 1 10 -57 -9 -24 0 0 0 0 -In T1, 1/2 is our
s1 0 1/2 -11/2 -5/2 9 1 0 0 0 key element, so
x1 will enter and
s2 0 1/2 -3/2 -1/2 1 0 1 0 0 s1 will leave
s3 0 1 1 1 1 0 0 1 1
Iteration 2 = T2
z x1 x2 x3 x4 s1 s2 s3 b
z 1 0 53 41 -204 -20 0 0 0 Key element here
x1 0 1 -11 -5 18 2 0 0 0 is 4. So x2 will
enter and s2 will
s2 0 0 4 2 -8 -1 1 0 0
leave.
s3 0 0 12 6 -17 -2 0 1 1

Iteration 3 = T3
z x1 x2 x3 x4 s1 s2 s3 b
z 1 0 0 29/2 -98 -27/4 -53/4 0 0
Key element here
x1 0 1 0 1/2 -4 -3/4 11/4 0 0 is 1/2. So x3 will
enter and x1 will
x2 0 0 1 1/2 -2 -1/4 1/4 0 0
leave
s3 0 0 0 0 7 1 -3 1 1
Iteration 4 = T4
z x1 x2 x3 x4 s1 s2 s3 b
Key element
z 1 -29 0 0 18 15 -93 0 0 here is 2. So
x3 0 2 0 1 -8 -3/2 11/2 0 0 x4 will enter
and x2 will
x2 0 -1 1 0 2 1/2 -5/2 0 0 leave.
s3 0 0 0 0 7 1 -3 1 1

Iteration 5 = T5
z x1 x2 x3 x4 s1 s2 s3 b
Key element
z 1 -20 -9 0 0 21/2 -141/2 0 0 here is 1/2.
x3 0 -2 4 1 0 1/2 -9/2 0 0 So s1 will
enter and x3
x4 0 -1/2 1/2 0 1 1/4 -5/4 0 0
will leave.
s3 0 7/2 -7/2 0 0 -3/4 23/4 1 1
Iteration 6 = T6
z x1 x2 x3 x4 s1 s2 s3 b
z 1 22 -93 -21 0 0 24 0 0 Key element
here is 1. So s2
s1 0 -4 8 2 0 1 -9 0 0
will enter and
x4 0 1/2 -3/2 -1/2 1 0 1 0 0 x4 will leave.
s3 0 1/2 5/2 3/2 0 0 -1 1 1

Iteration 7 = T7 = T1
z x1 x2 x3 x4 s1 s2 s3 b
z 1 10 -57 -9 -24 0 0 0 0 After 7 iterations, we reach
s1 0 1/2 -11/2 -5/2 9 1 0 0 0 back to the original table
with the same basic feasible
s2 0 1/2 -3/2 -1/2 1 0 1 0 0 solution.
s3 0 1 1 1 1 0 0 1 1
Understanding the concept

T7 T1

T6 Cycling T2 Optimality

T5 T3
T4
Basic definition of
Cycling:
• If a sequence of pivots starting from some basic feasible
solution ends up at the exact same basic feasible solution,
then we refer to this as “cycling.”
• If the simplex method cycles, it can cycle forever.

But then does this mean


Simplex Method can be infinite?
How to avoid cycling??
Bland’s Rule:
1. The entering variable should be the lowest index variable with positive
coefficient.
2. The leaving variable (in case of a tie in the min ratio test) should be the
lowest index row. (It is the row closest to the top, regardless of the leaving
variable.)
For example:
z x1 x2 x3 x4 x5 x6 b 1. Variables x1, x2, and x7 are all eligible to
enter the table. We choose the lowest
1 1 2 0 7 0 0 -20 index one, which is x1
0 3 3 0 2 1 0 6
2. We can pivot on the 4 in the column for x1.
0 4 2 0 -1 0 1 0 Or we can pivot on the 1. We pivot on the
4 because it is the row that is closest to
0 1 3 1 1 0 0 0
the top.
Let’s now apply Bland’s rule to our previous
example:
Iteration 7 = T7
z x1 x2 x3 x4 s1 s2 s3 b Now instead of
z 1 22 -93 -21 0 0 24 0 0 entering s2, we
s1 0 -4 8 2 0 1 -9 0 0 enter x1 into the
table. And we
x4 0 1/2 -3/2 -1/2 1 0 1 0 0
pivot on 1/2 so
s3 0 1/2 5/2 3/2 0 0 -1 1 1 that x4 leaves.

Iteration 8’ = T8’
z x1 x2 x3 x4 s1 s2 s3 b
z 1 0 -27 1 -44 0 -20 0 0 Using the normal
pivoting rules, we
s1 0 -4 -2 8 1 -1 0 0 0 pivot on 2. x3 enters
x1 0 1 -3 -1 2 0 2 0 0 the table and s3
leaves.
s3 0 0 4 2 -1 0 -2 1 1
Iteration 9 = T9
z x1 x2 x3 x4 s1 s2 s3 b
z 1 0 -29 0 -87/2 0 -19 -1/2 -1/2
s1 0 0 0 0 7 1 -3 1 1
x1 0 1 -1 0 3/2 0 1 1/2 1/2
x3 0 0 2 1 -1/2 0 -1 1/2 1/2

Our last iteration gives an optimal solution


where z = -1/2 for s1 = 1, x1 = 1/2 and x3 = ½

This example clearly shows that Bland’s rule can be used to get out of a
simplex cycle and reach an optimal solution.
THANK YOU

You might also like