Matrix Representations In this section, we use our knowledge of

advertisement
Matrix Representations
In this section, we use our knowledge of matrices to show how an LP’s optimal tableau can be
expressed in terms of the LP’s parameters. These will be used in study of sensitivity analysis
and duality.
Assuming we are solving a max. problem, prepared for solution by the big M method.
LP has m constraints and n variables. (Some of them may be slack, excess, or artificial).
We label variables X1, X2, ....Xn. Then, LP is,
s.t.
Max. Z = c1X1 + c2X2 + .........
a11X1 + a12X2 +
a21X1 + a22X2 +
+ cnXn
+ a1nXn = b1
+ a2nXn = b2
(1)
am1X1 + am2X2 +
Xi ≥ 0
+ amnXn = bm
( i = 1, 2, ... n)
Suppose we have found the optimal solution to (1). Let BVi be the basic variable for row i of
the optimal tableau. Also, define BV = {BV1, BV2, ......... BVm} to be the set of basic
variables in the optimal tableau. We define the mx1 vector
XBV =
XBV1
XBV2
....
....
XBVm
Also, NBV = set of non basic variables in the optimal tableau.
XNBV = (n – m)x1 vector listing the non basic variables (in any desired order).
As an example, if we consider the Dakota problem without the X2 ≤ 5 constraint,
Z=
60X1 + 30X2 + 20X3 + 0.S1 + 0.S2 + 0. S3
8X1 + 6X2 + X3 + S1
4X1 + 2X2 + 1.5X3
+ S2
2X1 + 1.5X2 + 0.5X3
+ S3
The optimal tableau is,
Z +
5X2
+ 10S2
+ 10S3
- 2X2
+ S1 + 2S2
- 8S3
- 2X2 + X3 +
2S2
- 4S3
X1 + 1.25X2
- 0.5S2 + 1.5S3
BV = (S1, X3, X1) with Z = 280, S1 = 24, X3 = 8, X1 = 2
NBV = (S2, S3, X2) all = 0
1
= 48
= 20
=8
= 280
= 24
=8
=2
(1’)
(2)
Then,
S1
X2
XBV =
X3
and
XNBV =
S2
X1
S3
Recalling that c1, c2, …., cn are the objective function coefficients for the variables X1, X2, …
Xn, we define
CBV as the 1xm row vector [CBV1 CBV2 ………. CBVm]
For Dakota problem, BV = {S1, X3, X1}, then CBV = [ 0 20 60]
We define CNBV as the 1x(n – m) row vector whose elements are the coefficients of the non
basic variables ( in the order of NBV). For Dakota problem,
NBV = {X2, S2, S3}, then
CNBV = [30 0 0]
Definition: The mxm matrix B is the matrix whose jth column is the column for BVj in
equation (1).
For Dakota problem, first column of B is S1 column in (1’), 2nd column is that of X3, and the
third, the X1 column. Thus,
B=
1
0
0
1
1.5
0.5
8
4
2
Definition: aj is the column (in the constraints) for the variable
Dakota problem,
6
a2 = 2
a (for S1) =
1.5
Xj in (1). For example, in
1
0
0
Definition: N is the mx(n – m) matrix whose columns are the columns for the non basic
variables (in the NBV order) in (1).
For Dakota, NBV = {X2, S2, S3}, then,
N=
6
2
1.5
0
1
0
0
0
1
Definition: The mx1 column vector b is the RHS of the constraints in (1).
For Dakota,
48
b = 20
8
2
Expressing the Constraints in any Tableau in terms of B-1 and Original LP
Equation (1) may be written as,
Z = CBV.XBV + CNBV.XNBV
s.t.
B.XBV + N.XNBV = b
XBV, XNBV ≥ 0
Using (3), for Dakota example,
S1
Max Z = [0 20 60] X3 + [30
X1
s.t.
1
0
0
1
1.5
0.5
S1
X3
X1
8
4
2
S1
X3
X1
X2
S2
S3
≥ 0
+
(3)
0
X2
0] S2
S3
6
2
1.5
0
1
0
0
0
1
X2
S2
S3
=
48
20
8
≥ 0
Multiplying, in (3), through B-1,
B-1.B.XBV + B-1.N.XNBV = B-1.b
XBV + B-1.N.XNBV = B-1.b
or
(4)
For the Dakota problem, it can be shown that,
1
B = 0
0
-1
2
2
-0.5
-8
-4
1.5
Then, equation (4) yields,
S1
X3
X1
or
+
S1
X3
X1
1
2 -8
0
2 -4
0 -0.5 1.5
+
-2
-2
1.25
6
2
1.5
2
2
-0.5
0
1
0
0
0
1
-8
-4
1.5
X2
S2
S3
X2
S2
S3
1
= 0
0
=
24
8
2
2
-8
2
-4
-0.5 1.5
48
20
8
(4’)
Of course, these are the constraints for the Dakota optimal tableau.
Note: From above, the column of a non basic variable Xj in the constraints of the optimal
tableau is given by,
B-1.[column for Xj in (1)] = B-1.aj
(5)
-1
Also, from (4),
RHS = B .b
(6)
3
Dakota example:
Column for X2 = B-1.a2 =
RHS = B-1.b =
1
0
0
1
0
0
2
2
-0.5
2
2
-0.5
-8
-4
1.5
-8
-4
1.5
48
20
8
6
2
1.5
=
=
-2
-2
1.25
24
8
2
Determining the Optimal Tableau’s Row 0 in terms of the initial LP
From (3),
B.XBV + N.XNBV = b
Multiplying by CBVB-1:
CBV.XBV + CBV.B-1.N.XNBV = CBV.B-1.b
(7)
and from (3) again,
Z - CBV.XBV - CNBV.XNBV = 0
(8)
Adding (7) and (8):
Z + (CBV.B-1.N – CNBV)XNBV = CBV.B-1.b
(9)
From (9), coefficient of Xj in row 0 is,
CBV.B-1.(column of N for Xj) – (coeff. for Xj in CNBV) = CBV.B-1.aj – cj
and
RHS of row 0 = CBV.B-1.b
Let cj be the coefficient of Xj in row 0:
cj = CBV.B-1.aj – cj
(10)
and, RHS in row 0 = CBV.B-1.b
(11)
For Dakota example:
CBV.B-1 = [ 0
20
60] 1
0
0
2
2
-0.5
-8
-4
1.5
= [0
10
10]
From (10), coefficient of non basic variable X2 is, c2,
-1
c2 = CBV.B .a2 = [ 0
For S2:
[0
10
0
10] 1
0
10
6
10] 2
1.5
- 30 = 5
- 0 = 10
0
For S3:
[0
10
10] 0
- 0 = 10
1
Of course, basic variables’ coefficients are zero in row 0.
4
-1
RHS of row 0 = CBV.B .b = [0
Hence,
10
48
20
8
10]
= 280
Z + 5X2 + 10S2 + 10S3 = 280
which is as determined before in (2).
Some Simplifications:
If Xj is slack variable Si, coefficient of Si is zero in objective function row 0, and the column
for Si in original tableau has 1 in row i and zero in all other rows. Then, from (10):
Coeff. of Si in optimal row 0 = ith element of CBV.B-1 – 0
= ith element of CBV.B-1
Similarly, for excess variable coeff. of ei in optimal row 0 = - (ith element of CBV.B-1)
If Xj is an artificial variable ai, objective function coefficient of ai is –M (for a maximization
problem) and original column for ai has 1 in row i and 0 in all other rows. Then,
Coeff. of ai in optimal row 0 = (ith element of CBV.B-1) – (-M)
= ith element of CBV.B-1 + M
Example: For the following LP the optimal basis is BV = {X2, S2}. Compute the optimal
tableau.
Max. Z = X1 + 4X2
s.t.
X1 + 2X2 ≤ 6
2X1 + X2 ≤ 8
X1, X2 ≥ 0.
After adding slack variables:
Max. Z = X1 + 4X2
s.t.
X1 + 2X2 + S1
=6
2X1 + X2 + + S2 = 8
Then,
B= 2
0
and, hence, B-1 = 1/2
0
1
1
-1/2 1
Using (5) and (6) for non basic variable X1:
a1 = 1
2
The column for X1 in optimal tableau is,
B-1.a1 =
1/2
-1/2
0
1
1
2
= 1/2
3/2
The other non basic variable is S1. Column for S1 in original tableau = 1
0
Column for S1 in optimal tableau is: 1/2
-1/2
0
1
1
0
5
= 1/2
-1/2
Because
b= 6
8
RHS for constraints = 1/2
-1/2
0
1
6
8
= 3
5
For optimal tableau row 0:
CBV = [4
0]
CBV.B-1 = [4
0]
1/2
-1/2
0
1
= [2
0]
Coefficient of X1 in row 0 = CBV.B-1.a1 – c1
= [2
0]
1
2
= 1
Coefficient of S1 = First element of CBV.B-1 = 2
RHS of row 0 = CBV.B-1.b = [2
0]
6
= 12
8
X2 : basic variable in row 1
S2:
“
“
“ “ 2
Hence, optimal tableau is:
Z+
X1
(1/2)X1
X2
(3/2)X1
+2S1
= 12
+ (1/2)S1
=3
- (1/2)S1
+ S2
=5
Note:
Let us now go back to the Dakota problem. We started with a basic feasible solution where S1,
S2, and S3 were the basic variables. In solving the problem, we have carried out elementary
row operations (ERO’s) that transformed
Initial tableau
from
Final tableau
S1
S2
S3
1
0
0
0
1
0
0
0
1
to
6
S1
S2
S3
1
0
0
2
2
-0.5
-8
-4
1.5
The same ERO’s have transformed the B matrix,
from B =
S1
X3
X1
S1
X3
X1
1
0
0
1
1.5
0.5
8
4
2
1
0
0
0
1
0
0
0
1
to
Looking at the above operations, we see that, in solving the Dakota problem by the simplex
algorithm, we have used ERO’s to transform B to I3 (identity matrix). The same ERO’s
transformed I3 into
1
0
0
2
2
-0.5
-8
-4
1.5
which becomes, therefore, B-1
For any simplex tableau, B-1 is the mxm matrix consisting of the columns in the current
(or optimal) tableau that correspond to the initial tableau’s set of basic variables taken
in the same order. For example, if starting, we have only slack variables, then B-1 for the
optimal tableau is simply the columns for the slack variables in the constraints of the optimal
tableau. If starting basic variable for the ith constraint is the artificial variable ai, then the ith
column of B-1 will be the column for ai in the optimal tableau.
In the last example solved, initial basic variables were S1 and S2. Looking at the final tableau,
the coefficients of S1 and S2 are given by
S1
S2
1/2
-1/2
0
1
which, as can be seen, is also B-1.
7
Download