max: z = x1 + x2
s.t.: x1 + 2x2 ≤ 8
3x1 + 2x2 ≤ 12
x1 + 3x2 ≥ 3 <----- **** New "feature ****
|
|
|
Constraint:
x1 + x2 ≥ 5 (x1 ≥ 0, x2 ≥ 0 are implied)
|
max: z = x1 + x2
s.t.: x1 + 2x2 ≤ 8
3x1 + 2x2 ≤ 12
x1 + 3x2 ≥ 3
|
Re-write the Linear Programming problem as a system of linear equations (=):
z = x1 + x2 ⇒ z - x1 - x2 = 0
x1 + 2x2 ≤ 8 ⇒ x1 + 2x2 + s1 = 8
3x1 + 2x2 ≤ 12 ⇒ 3x1 + 2x2 + s2 = 12
x1 + 3x2 ≥ 3 ⇒ x1 + 3x2 - s3 = 3
|
Linear system:
z - x1 - x2 = 0
x1 + 2x2 + s1 = 8
3x1 + 2x2 + s2 = 12
x1 + 3x2 - s3 = 3
|
Note:
|
|
|
Big trouble:
|
|
I like the two-phase Simplex method because it's more intuitive (so I'll teach you that :-))
x1 x2 s1 s2 s3 z | RHS
===============================+====
-1 -1 0 0 0 1 | 0
1 2 1 0 0 0 | 8
3 2 0 1 0 0 | 12
1 3 0 0 -1 0 | 3
|
|
|
|
x1 x2 s1 s2 s3 a1 z | RHS
====================================+====
-1 -1 0 0 0 0 1 | 0
1 2 1 0 0 0 0 | 8
3 2 0 1 0 0 0 | 12
1 3 0 0 -1 1 0 | 3
|
The corresponding solution is:
z = 0 s1 = 8 s2 = 12 a1 = 3 <--- "Remove" this variable |
|
|
x1 x2 s1 s2 s3 a1 z | RHS
====================================+====
-1 -1 0 0 0 0 1 | 0 <-- Objective function
1 2 1 0 0 0 0 | 8
3 2 0 1 0 0 0 | 12
1 3 0 0 -1 1 0 | 3
|
Fact:
|
|
|
is:
max: -a1 - a2 - ... - am
(Remember that:
a1 ≥ 0
a2 ≥ 0
...
am ≥ 0 )
|
Because:
|
Now:
|
More importantly:
|
|
1. Set up an initial Simplex Tableau:
1a. Add a surplus variable si to each:
"≤"-constraint and
"≥"-constraint
Note: surplus variables of "≥"-constraint has negative sign !
2. If there is one or more "≥"-constraints
then:
2a: Add an artificial variable ai to each ≥ constraint
2b. Use the Simplex method to solve:
max: -a1 - a2 - ... - an
Using same set of constraints
Note: you need to fix the Simplex Tableau first (see example)
2c. When Simplex method terminates,
replace the objective row of the Final Simplex Tableau
by the original objective function
3. Use the Simplex method to solve the LP
Note: you need to fix the Simplex Tableau first (see example)
|
|
max: z = x1 + x2
s.t.: x1 + 2x2 ≤ 8
3x1 + 2x2 ≤ 12
x1 + 3x2 ≥ 3
|
max: z - x1 - x2 = 0
s.t.: x1 + 2x2 + s1 = 8
3x1 + 2x2 + s2 = 12
x1 + 3x2 + s3 = 3
|
Re-written in table form:
x1 x2 s1 s2 s3 z | RHS
===============================+====
-1 -1 0 0 0 1 | 0
1 2 1 0 0 0 | 8
3 2 0 1 0 0 | 12
1 3 0 0 -1 0 | 3
|
(which did not have a feasible initial basic solution)
|
|