Lecture 10
Lecture 10
ME F320/MF F320
BITS Pilani
Pilani Campus
3.4 Artificial
Starting Solution
2
Artificial Starting Solution
• LPs in which all constraints are with
nonnegative right-hand sides offer a convenient
“all-slack” starting basic feasible solution.
• “Ill-behaved” LPs: models with (=) and/or (≥)
constraints.
– use artificial variables as slacks in 1st iteration
artificial variables disposed of later.
– M Method
– 2-phase Method
3
3.4.1 Big
M-Method
4
M-Method
• Example:
Minimize:
z = 4x1 + x2
subject to
3x1 + x2 = 3
4x1 + 3x2 ≥ 6
x1 + 2x2 ≤ 4
x1 , x2 ≥ 0
5
M-Method
Step 1: Convert to standard form
Minimize:
z = 4x1 + x2
subject to
3x1 + x2 = 3
4x1 + 3x2 − S1 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 ≥ 0
6
M-Method
Step 2: Add artificial variables R1 and R2
Minimize: −M in
z = 4x1 + x2 + M(R1 + R 2 ) maximization,
and +M for
subject to minimization
3x1 + x2 + R1 = 3
4x1 + 3x2 − S1 + R 2 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 , R1 , R 2 ≥ 0
• Artificial variables forced to zero by the time optimum is
reached.
• M is a large positive value (M → ∞).
7
M-Method
Step 2: Add artificial variables R1 and R2
Minimize:
z = 4x1 + x2 + M(R1 + R 2 )
subject to
3x1 + x2 + R1 = 3
4x1 + 3x2 − S1 + R 2 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 , R1 , R 2 ≥ 0
• n = 6, m = 3
• Starting basic solution (R1 = 3, R 2 = 6, s2 = 4)
8
M-Method
Step 3: Choose M
• M should be sufficiently large to force the artificial
variable to zero.
• If artificial variables are non-zero in the optimum
solution no feasible solution exits for the original
LPP.
• M shouldn’t be too large causes round-off errors in
computations.
• Choose M = 100 for the current problem.
9
Simplex Tableau
• Starting Simplex Tableau (starts at origin)
z − 4x1 − x2 − 100 R1 + R 2 = 0
Basic z x1 x2 S1 R1 R2 s2 Solution
z row 1 −4 −1 0 −100 −100 0 0
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
Z-row is inconsistent!
11
Gauss-Jordan row operations
• Substitute R1 and R2 in z (in terms of non-basic
variables)
– New z row = Current z row + M R1 row + M(R2 row)
Basic z x1 x2 S1 R1 R2 s2 Solution
z row 1 696 399 −100 0 0 0 900
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
Basic z x1 x2 S1 R1 R2 s2 Solution
z row 1 696 399 −100 0 0 0 900
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
14
New Simplex Tableau
Basic z x1 x2 S1 R1 R2 s2 Solution
z row 1 696 399 −100 0 0 0 900
x1 row 0 3/3 1/3 0 1/3 0 0 3/3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
18
New Simplex Tableau
Basic z x1 x2 S1 R1 R2 s2 Solution
z row 1 0 167 −100 −232 0 0 204
x1 row 0 1 1/3 0 1/3 0 0 1
R2 row 0 0 5/3 −1 −4/3 1 0 2
s2 row 0 0 5/3 0 −1/3 0 1 3
19
3.4.2 Two-Phase
Method
20
Two-Phase Method
• The two-phase method eliminates use of
constant M.
• Solves LPP in two phases:
– Phase I: find a starting basic feasible solution.
– Phase II: solve original problem.
21
Two-Phase Method: Phase I
• Phase I:
i. Put problem in equation form, and add artificial
variables to constraints (exactly as in the M-
method) to secure a starting basic solution.
ii. Find basic solution of resulting equations that
minimizes sum of the artificial variables (r =
R1 + R2 +…).
iii. r > 0 no feasible solution, otherwise (r = 0),
proceed to Phase II.
22
Two-Phase Method: Phase I
• Example:
Minimize:
z = 4x1 + x2
subject to
3x1 + x2 = 3
4x1 + 3x2 ≥ 6
x1 + 2x2 ≤ 4
x1 , x2 ≥ 0
23
Two-Phase Method: Phase I
Step 1: Convert to standard form
Minimize:
z = 4x1 + x2
subject to
3x1 + x2 = 3
4x1 + 3x2 − S1 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 ≥ 0
24
Two-Phase Method: Phase I
Step 2: Add artificial variables R1 and R2
Minimize:
z = 4x1 + x2
subject to
3x1 + x2 + R1 = 3
4x1 + 3x2 − S1 + R 2 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 , R1 , R 2 ≥ 0
25
Two-Phase Method: Phase I
Step 3: Solve the Phase I problem
Minimize:
r = R1 + R 2
subject to
3x1 + x2 + R1 = 3
4x1 + 3x2 − S1 + R 2 = 6
x1 + 2x2 + s2 = 4
x1 , x2 , S1 , s2 , R1 , R 2 ≥ 0
• Solution of the Phase I problem (r = 0; R1 = 0 and R2 = 0) will
generate a feasible basic solution for the original LPP.
26
Phase I: Simplex Tableau
• Starting Simplex Tableau (starts at origin)
r = R1 + R 2
Basic r x1 x2 S1 R1 R2 s2 Solution
r row 1 0 0 0 −1 −1 0 0
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
r-row is inconsistent!
28
Phase I: Row Operations
• Substitute R1 and R2 in r (r in terms of non-basic
variables)
– New r row = Current r row + R1 row + (R2 row)
Basic r x1 x2 S1 R1 R2 s2 Solution
r row 1 7 4 −1 0 0 0 9
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
Basic r x1 x2 S1 R1 R2 s2 Solution
r row 1 7 4 −1 0 0 0 9
R1 row 0 3 1 0 1 0 0 3
R2 row 0 4 3 −1 0 1 0 6
s2 row 0 1 2 0 0 0 1 4
30
Phase I: Optimum
• Minimum value is r = 0
– Phase I produced a feasible basic solution.
– (x1 = 3/5, x2 = 6/5, s2 = 1)
– Eliminate artificial variables.
Basic r x1 x2 S1 R1 R2 s2 Solution
r row 1 0 0 0 −1 −1 0 0
x1 row 0 1 0 1/5 3/5 −1/5 0 3/5
x2 row 0 0 1 −3/5 −4/5 3/5 0 6/5
s2 row 0 0 0 1 1 −1 1 1
31
Phase II
• Delete artificial columns, original problem becomes:
Minimize:
z = 4x1 + x2
subject to
1 3
x1 + S1 =
5 5
3 6
x2 − S1 =
5 5
S1 + s2 = 1
x1 , x2 , S1 , s2 ≥ 0
32
Phase II: Simplex Tableau
• Starting Simplex Tableau
z = 4x1 + x2
Basic z x1 x2 S1 s2 Solution
z row 1 4 1 0 0 0
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
33
Phase II: Simplex Tableau
• Starting Simplex Tableau
z = 4x1 + x2
Basic z x1 x2 S1 s2 Solution
z row 1 −4 −1 0 0 0
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
34
Phase II: Simplex Tableau
• Starting Simplex Tableau
z = 4x1 + x2
Basic z x1 x2 S1 s2 Solution
z row 1 −4 −1 0 0 0
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
35
Phase II: Simplex Tableau
• Starting Simplex Tableau
z = 4x1 + x2
Basic z x1 x2 S1 s2 Solution
z row 1 −4 −1 0 0 0
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
z-row is inconsistent!
36
Phase II: Row Operations
• Basic variables (x1 and x2) must be substituted out:
New z row = Current z row + 4 × x1 row + (1 × x2 row)
Basic z x1 x2 S1 s2 Solution
z row 1 −4 −1 0 0 0
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
37
Phase II: Starting Simplex Tableau
• Starting Simplex Tableau
1 18
Minimize: z = − S1 +
5 5
Basic z x1 x2 S1 s2 Solution
z row 1 0 0 1/5 0 18/5
x1 row 0 1 0 1/5 0 3/5
x2 row 0 0 1 −3/5 0 6/5
s2 row 0 0 0 1 1 1
41
Phase II: Final Simplex Tableau
• Final Simplex Tableau:
1 17
Minimize: z = s2 +
5 5
Basic z x1 x2 S1 s2 Solution
z row 1 0 0 0 −1/5 17/5
x1 row 0 1 0 0 −1/5 2/5
x2 row 0 0 1 0 3/5 9/5
S1 row 0 0 0 1 1 1
42
Thank you!
43