After one last project presentation, we moved on to a new chapter: Linear Programming.
Follow the links for the pdf file of the slides or to download the LaTeX source:
The typesetting of the document with latex can be done on the UNIX machine icarus.For more information, see Linear Programming Frequently Asked Questions
We demonstrated the simplex algorithm on the following simple problem
max 3*x1 + 5*x2
subject to
x1 <= 4
2*x2 <= 12
3*x1 + 2*x2 <= 18
x1 >= 0, x2 >= 0
We can interpret the original problem on the left as
the determination of the optimal mix for a production
of two goods, x1 (sells at $3/unit) and x2 (sells at $5/unit),
subject to production capacity constraints.
Drawing all the lines in the plane, we can see the solution.
To find the optimal solution, we bring the problem in tableau form:
3 5 | 0 0 0 | 0 max 3*x1 + 5*x2
------+-----------+-----
1 0 | 1 0 0 | 4 x1 + x3 = 4
0 2 | 0 1 0 | 12 2*x2 + x4 = 12
3 2 | 0 0 1 | 18 3*x1 + 2*x2 + x5 = 18
where the variables x3, x4, and x5 are slack variables.
So our initial solution is (x1,x2,x3,x4,x5) = (0,0,4,12,18).
At this stage we do not make a profit. We first choose the
variable which will become nonzero. Since we have a greater
profit from x2 than from x1 we decide to let x2 grow.
If x2 grows, some other variable have to get smaller.
From the constraints, we have three candidates:
x3 = 4 - x1 >= 0 -> no limit on x2
x4 = 12 - 2*x2 >= 0 -> x2 <= 6
x5 = 18 - 3*x1 - 2*x2 >= 0 -> x2 <= 9
So x2 can get at most 6 (larger values for x2 will make x4 negative).
With Gauss-Jordan, we update the tableau, with pivot in second column
(x2 comes in the basis) and second row (x4 leaves the basis):
3 0 | 0 -5/2 0 | -30 max 3*x1 - 5/2*x4 + 30
------+-------------+-----
1 0 | 1 0 0 | 4 x1 + x3 = 4
0 1 | 0 1/2 0 | 6 x2 + 1/2*x4 = 6
3 0 | 0 -1 1 | 6 3*x1 - x4 + x5 = 6
We currently make a profit of 30, but we can still do better if we
let x1 grow. Then (exercise), x5 has to leave the basis.
The final tableau is
0 0 | 0 -3/2 -1 | -36 max - 3/2*x4 - x5 + 36
------+---------------+-----
0 0 | 1 1/3 -1/3 | 4 x3 + 1/3*x4 - 1/3*x5 = 2
0 1 | 0 1/2 0 | 6 x2 + 1/2*x4 = 6
1 0 | 0 -1/3 1/3 | 2 x1 - 1/3*x4 + 1/3*x5 = 2
We can read off the solution: (x1,x2) = (2,6) with value 36.
At the same time we solve the dual problem:
min 4*y1 + 12*y2 + 18*y3
subject to
y1 + 3*y3 >= 3
2*y2 + 2*y3 >= 5
y1 >= 0, y2 >= 0
From the top row of the last tableau we read off: (y1,y2,y3) = (0,3/2,1).