Lecture 9

advertisement
9. Linear Programming
(Simplex Method)
Objectives:
1. One solution? No solution? Infinitely many solutions?
How do we tell?
Refs: B&Z 5.4.
Example
max P = x1+ 2x2
subj to
x1 - x2 ≤ 1
-2x1+ x2 ≤ 4
x1 ≥ 0 x2 ≥ 0
First we convert to standard form:
max P - x1 - 2x2 = 0
x1 - x2 + s1
=1
-2x1+ x2
+ s2 = 4
x1 ≥ 0
x2 ≥ 0
s1 ≥ 0
s2 ≥ 0
x1 - x2 + s1
-2x1 + x2
- x1 - 2x2
=
1
+ s2
=4
+P =0
BV
x1
x2
s1
s2
P
RHS
s1
1
1
1
0
0
1
s2
2
1
0
1
0
4
P
1 2
0
0
1
0
most negative
value
BV
x1
s1
1
x2
P

R2  R1  R1
no option but to
pivot here
R3  2R2  R3
x2
s1
s2
P
RHS
0
1
1
0
5
2
1
0
1
0
4
5
0
0
2
1
8

BV
x1
x2
s1
s2
P
RHS
s1
1
0
1
1
0
5
x2
2
1
0
1
0
4
P
5
0
0
2
1
8
No entry in the column
is positive so there
is nowhere to pivot.
most negative
value
Our conclusion is that there is no optimal solution.
The feasible region is unbounded in the direction of
increasing P.
inc P
Another Example
max P = 4x1+ 8x2
subj to
2x1 + 4x2 ≤ 200
6x1+ x2 ≤ 100
x1 ≥ 0 x2 ≥ 0
First we convert to standard form:
max
P - 4x1 - 8x2
=0
2x1 + 4x2 + s1
= 200
6x1+ x2
+ s2 = 100
x1 ≥ 0
x2 ≥ 0
s1 ≥ 0
s2 ≥ 0
2x1 + 4x2 + s1
6x1 + x2
+ s2
-4x1 - 8x2
+P
= 200
= 100
=0
BV
x1
x2
s1
s2
P
RHS
s1
2
4
1
0
0
200
200/4=50
R1  4  R1
s2
6
1
0
1
0
100
100/1=100
R2  R1  R2
P
4 8
0
0
1
0
most negative
value
BV
x2
s2
P
x1
1
2
51
2
0
x2
1
0
0
R3  8R1  R3


s1

1
4
1
4
2
s2
P
RHS
0
0
50
1
0
50
0
1
400
BV
x2
s2
P
x1
1
2
51
2
0
this one has been
obtained incidentally
x2
1
0
0
s1
1
4
1
4
2
s2
P
RHS
0
0
50
1
0
50
0
1
400
these are deliberate zeroes
Look at the zeroes in the bottom row.
This tells us that there is more than one optimal solution.
The solution we can read off is
(x1, x2, s1, s2)=(0, 50, 0, 50) P* = 400
Let’s go back to the equations and see what this degeneracy
means.
BV
x1
x2
s1
s2 P RHS
1
x2
1 1
0 0 50
2
4
s2 5 1
0 1
1 0 50
2
4
P
0
0
2
0 1 400
On the bottom row we have

P + 2s1 = 400
So P = 400 provided s1 = 0.
Row 1: 1/2 x1 + x2 + 1/4 s1 = 50
Row 2: 11/2 x1 - 1/4 s1 + s2 = 50
Now let’s set s1 = 0.
Row 1: 1/2 x1 + x2 = 50
We can solve these equations
simultaneously.
Row 2: 11/2 x1 + s2 = 50
1
1 0 502R1  R1
 2

2 R R
11
0
1
50


2
 2
 11 2
1 2 0
100 

~ 
2
100
1 0
11
11 R2  R1  R2

~

100
1 2
0
100 R1  R2  R1 1 0 2 11

11 




~
2
1000 
2
1000
0
2
0
2




11
11
11
11

~
R2 2  R2
1 0 2
100  So we have x2 - 1/11 s2 = 500/11
11
11

x1 + 2/11 
s2 = 100/11
1
500
0
1


  Set t = s
11
11
x1 = 1/11(100 - 2t)
2
x2 = 1/11(500 + t).
Now remember that x1, x2 , s2 ≥ 0.
So for x2 ≥ 0 we need x2 = 1/11(500 + t) ≥ 0
 500 + t ≥ 0
 t ≥ -500
and for x1 ≥ 0 we need x1 = 1/11(100 - 2t) ≥ 0
 100 - 2t ≥ 0
 t ≤ 50
So the optimal solution is
(x1, x2 , s1, s2) = (1/11(100 - 2t), 1/11(500 + t), 0, t)
where 0 ≤ t ≤ 50, P*=400.
These equations represent the straight line segment joining
1/11(100,500) to (0, 50).
(solution set)
(100/11, 500/11)
50
100/6
You should now be
able to complete
Example Sheet 3
from the Orange Book.
Download