lec6on inverse matrix
lec6on inverse matrix
Optimization I Lecture 6
3. Otherwise, choose j such that c̄j < 0. Variable xj enters the basis.
4. Let u = B−1 Aj . If ui ≤ 0 for all i, then the optimal value is −∞, and the algorithm terminates.
5. Otherwise, set θ∗ = mini:ui >0 xB(i) /ui , and let ` be such that θ∗ = xB(`) /u` . Variable xB(`) leaves the
basis.
6. The new basis is obtained by replacing AB(`) by Aj , and the new bfs by setting xnew
j = θ∗ and
new ∗
xB(i) = xB(i) − θ ui for i = 1, . . . , m.
We saw last time that, if we have an initial bfs, and there is no degeneracy, then the Simplex Method
finds an optimal solution or correctly reports that the optimal value is −∞ in finite time.
We will see how to prevent cycling in the case of degeneracy and how to find an initial basic feasible
solution. Before we deal with these questions, we’ll see a more convenient way of doing a simplex iteration.
1
• Now, if we update B in the Simplex Method, we just change one column. Suppose we replace column 2
4
with the column 2 , and suppose we do the exact same operations as we did previously. Then only
1
the second column of the 3 × 6-matrix above changes. We also know what the second column looks
4
like after the last step of the Gauss-Jordan elimination we did above: it will be equal to B−1 2 =
1
1 1
3
4 4 0 4 2
1 − 3
0 2 = − 1 .
4 4 2
− 14 3
4 1 1 3
2
So we can reuse our previous computations and find the new inverse as follows:
3 1 1
1 2 0 | 4 4 0 add 3R2 to R1, add 3R2 to R3, divide R2 by − 1 1 0 0 | 1 −2 0
0 −1
2 0 | 1
4 − 3
4 0 → 2
0 1 0 | − 12 3
2 0 .
0 3
2 1 | − 14 3
4 1 0 0 1 | − 12 − 32 1
1 −2 0
So B−1
new = − 12 3
2 0 .
− 12 − 32 1
• Note that for an m × m matrix, we thus only have to do O(m2 ) operations to update the inverse. Note
that we can omit column 1 and 3 from the 3 × 6 matrix above (since they don’t change anyway).
In general, when we change to a new basis, we replace the `-th column of B, AB(`) , by Aj . This
changes the `-th column of
the outcome of the Gauss-Jordan elimination computation that computes
B− 1 (i.e., Im | B−1 ) to B−1 Aj = u, so we get
c̄j 0
The j-th column of the tableau looks like this: . If j = B(i), then this is equal to .
B−1 Aj ei
2
• c̄j for all j is given in row 0, so we can just pick a column j with c̄j < 0. We call this the pivot column.
• Column j in the tableau also contains B−1 Aj which is the vector u we need.
• Let ` be the index of the row that minimizes xB(i) /ui over all rows with ui > 0 (this is called the
minimum ratio test). We call row ` the pivot row, and (`, j) the pivot element.
• Update the tableau: add/subtract multiples of the `-th row to the other rows, so that the j-th column
has a 1 in position (`, j) and 0 everywhere else.
To see this is correct, recall that we already argued that doing elementary row operations is the same as
premultiplying by some matrix Q. First consider the rows 1, . . . , n of the tableau. Note that the matrix
Q satisfies QB−1 AB(i) = ei for all i 6= ` (since the columns for the variables that
remain basic stay the
−1
same),
−1 and QB −1
A =
j e ` . So QB−1
B new = Im , or QB −1
= B −1
new . Then Q B b | B−1 A =
−1
Bnew b | Bnew A which is exactly what we need.
For row 0, note that it is originally equal to
Then we add some multiple γ of row `, which is itself equal to b−1,T b | A , where b−1,T
i i is the
i-th row of B−1 . So, the new row 0 is
0 -2 -1 0 0 0
6 3 1 1 0 0
2 1 -1 0 1 0
3 0 1 0 0 1
We choose x1 as the entering variable. We have a choice for the pivot row (or leaving variable), since
6
3 = 21 . We choose the second row, which means x4 leaves the basis. We add/subtract copies of the second
row to each other row, so that the first column has 0’s everywhere except in the second row.
3
4 0 -3 0 2 0
0 0 4 1 -3 0
2 1 -1 0 1 0
3 0 1 0 0 1
Note that this solution is degenerate.
In the next iteration, x2 is our only choice for the entering variable, and the first row is the pivot row
(so x3 is the leaving variable).
4 0 0 3/4 -1/4 0
0 0 1 1/4 -3/4 0
2 1 0 1/4 1/4 0
3 0 0 -1/4 3/4 1
Note that this is the same solution (x1 , x2 , x3 , x4 , x5 ) = (2, 0, 0, 0, 3). Now, we let x4 enter the basis. The
pivot row is the last row.
5 0 0 2/3 0 1/3
3 0 1 0 0 1
1 1 0 1/3 0 -1/3
4 0 0 -1/3 1 4/3
We have found an optimal solution, x(1 , x2 , x3 , x4 , x5 ) = (1, 3, 0, 4, 0) with objective value −5.
Remarks: