tie for entering variable

advertisement
EE/Econ 458
The Simplex Method using the
Tableau Method
J. McCalley
1
Our example problem
F
 3 x1
 5 x2
 x3
x1
 x4
2 x2
3 x1
 2 x2
 x5

0
(1)

4
(2)

12
(3)

18
(4)
The tableau for initial solution
B asic
v ariable
Eq.
#
F
x1
F
x3
x4
x5
0
1
2
3
1
0
0
0
-3
1
0
3
C o efficien ts o f
x2
x3
-5
0
2
2
0
1
0
0
x4
x5
R ight
sid e
0
0
1
0
0
0
0
1
0
4
12
18
Not yet optimal!
2
Iteration 1 – determine entering variable
Select the variable that improves the objective at the highest rate
(i.e., the largest amount of objective per unit change in variable).
This is the one in the first row that is most negative.
B asic
v ariable
Eq.
#
F
x1
F
x3
x4
x5
0
1
2
3
1
0
0
0
-3
1
0
3
C o efficien ts o f
x2
x3
-5
0
2
2
0
1
0
0
x4
x5
R ight
sid e
0
0
1
0
0
0
0
1
0
4
12
18
Pivot column
3
Iteration 1 – determine leaving variable
Choose leaving variable to be the one that hits 0 first as entering
variable is increased, as dictated by one of the m constraint equations
B asic
E quation
variable
x3
x 1+ x 3= 4
x4
2x 2 + x 4 = 12
x5
3x 1 + 2x 2 + x 5 = 18
U pper bound for x 2
N o lim it im posed
x 2 = (12 -0)/2= 6
x 2 = (18 -3(0)-0)/2= 9
1. Identify each equation that contains the entering variable (x2) and therefore imposes a
constraint on how much it can be increased. In the table , this is the last two equations
(the ones for x4 and x5).
2. For each identified equation, we solved for the entering variable (x2). Notice in the
table that in both cases, this turned out to be x2=[RHS-0-0….]/[coefficient of x2]. The
numerator subtracts zero(s) because, except for the entering variable and the righthand-side, all other terms in each equation are zero! This is because each equation has
only one basic (non-zero) term in it, and we are pushing this term to zero in order to
see how much we can increase the entering variable (x2).
3. The leaving variable is the one that hits 0 for the least value of the entering variable.
4
Iteration 1 – determine leaving variable
Choose leaving variable to be the one that hits 0 first as entering
variable is increased, as dictated by one of the m constraint equations
Basic
Eq.
variable #
0
F
1
x3
2
x4
3
x5
F
1
0
0
0
x1
-3
1
0
3
Coefficients of
x2
x3
-5
0
0
1
2
0
2
0
x4
0
0
1
0
x5
0
0
0
1
Right
side
0
4
12
18
12
 6
2
18
9
2
1. Identify each equation that contains the entering variable (x2) and therefore imposes a
constraint on how much it can be increased. In a Tableau, this will be the rows that
have non-zero values for the entering variable, i.e., the rows that have non-zero values
in the pivot column.
2. For each identified row in the Tableau, solve for the entering variable (x2) using:
x2=[RHS]/[coefficient of x2].
3. The leaving variable is identified by the equation having minimum ratio given in step 2
as the previously basic (nonzero) variable of this equation.
Basic
Eq.
variable #
0
F
1
x3
2
x4
3
x5
F
1
0
0
0
x1
-3
1
0
3
Coefficients of
x2
x3
-5
0
0
1
2
0
2
0
x4
0
0
1
0
x5
0
0
0
1
Right
side
0
4
12
18
The pivot element is the
intersection of the two
boxes.
5
Iteration 1 – find new BFS
Using the equation used to identify the leaving variable as the pivot
row, eliminate the entering variable from all other equations.
A. Re-write the tableau so that
•
x2 replaces x4 in the left-hand-column of basic variables, and
•
the pivot row is divided by the pivot element
Basic
Eq.
variable #
0
F
1
x3
2
x2
3
x5
F
1
0
0
0
x1
-3
1
0
3
Coefficients of
x2
x3
-5
0
0
1
1
0
2
0
x4
0
0
0.5
0
x5
0
0
0
1
Right
side
0
4
6
18
Divided
by 2
B. To eliminate x2 from all other equations (including objective), add
an appropriate multiple of it to each row.
Basic
Eq.
variable #
0
F
1
x3
2
x2
3
x5
F
1
0
0
0
x1
-3
1
0
3
Coefficients of
x2
x3
0
0
0
1
1
0
0
0
x4
2.5
0
0.5
-1
x5
0
0
0
1
Right
side
30
4
6
6
Add 5 ×
pivot row
Add -2 ×
pivot row
6
Exceptions – tie for entering variable
What happens if there is a tie for the entering variable, i.e., if there
are two variables with the same coefficient in the objective function?
The way it was….
The way it could be….
F  3 x1  5 x 2
F  3 x1  3 x 2
 Choose one of them arbitrarily
as the entering variable.
You either move to one corner point or another. Either way, the
simplex will arrive at the optimal answer eventually. Choosing
one over the other may get you there faster (with fewer
iterations), but there is, in general, no way to know at this point
7
Exceptions – tie for leaving variable
What happens if we have two variables hitting zero for the same
value of the entering variable?
The way it was….
B asic
E quation
variable
x3
x 1+ x 3= 4
x4
2x 2 + x 4 = 12
x5
3x 1 + 2x 2 + x 5 = 18
U pper bound for x 2
N o lim it im posed
x 2 = (12 -0)/2= 6
x 2 = (18 -3(0)-0)/2= 9
The way it could be….
B asic
E quation
variable
x3
x 1+ x 3= 4
x4
2x 2 + x 4 = 12
x5
3x 1 + 2x 2 + x 5 = 12
Should you choose x4 or x5 as the leaving variable? The best
answer is x5 because then you move along constraint 3 to get
to the lower right-hand corner point in the next iteration. But
choosing x4 will also get there, it will just take 1 more iteration.
U pper bound for x 2
N o lim it im posed
x 2 = (12 -0)/2= 6
x 2 = (12 -3(0)-0)/2= 6
8
Exceptions – no leaving variable
What happens if we have NO variables hitting zero for the same
value of the entering variable?
The way it was….
B asic
E quation
variable
x3
x 1+ x 3= 4
x4
2x 2 + x 4 = 12
x5
3x 1 + 2x 2 + x 5 = 18
U pper bound for x 2
N o lim it im posed
x 2 = (12 -0)/2= 6
x 2 = (18 -3(0)-0)/2= 9
The way it could be….
B asic
E quation
variable
x3
x 1+ x 3= 4
x4
4x 1 + x 4 = 12
x5
3x 1 + x 5 = 18
x2 is unbounded (no feasible solution). We recognize this when
we cannot choose the leaving variable due to no limits
imposed on the increase in the entering variable. In such case,
we stop the iterations and report the solution is unbounded.
U pper bound for x 2
N o lim it im posed
N o lim it im posed
N o lim it im posed
9
Download