0% found this document useful (0 votes)
15 views43 pages

Lecture 07

The document discusses the transition from graphical to algebraic solutions in linear programming, particularly focusing on the simplex method. It outlines the process of identifying basic solutions, the role of entering and leaving variables, and the iterative nature of the simplex algorithm. Additionally, it provides examples and computations to illustrate the application of the simplex method in optimizing linear functions.

Uploaded by

f20221605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views43 pages

Lecture 07

The document discusses the transition from graphical to algebraic solutions in linear programming, particularly focusing on the simplex method. It outlines the process of identifying basic solutions, the role of entering and leaving variables, and the iterative nature of the simplex algorithm. Additionally, it provides examples and computations to illustrate the application of the simplex method in optimizing linear functions.

Uploaded by

f20221605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

ENGINEERING OPTIMIZATION

ME F320/MF F320

BITS Pilani
Pilani Campus
LP Model in
Equation Form

2
From Graphical to
Algebraic Solution

3
From Graphical to Algebraic Solution

4
From Graphical to Algebraic Solution

5
From Graphical to Algebraic Solution
• Algebraic solution space
– m equations and n variables
– n>m
– basic solutions  set n−m variables equal to zero
– Maximum number of basic solutions: ?

6
From Graphical to Algebraic Solution
• Algebraic solution space
– m equations and n variables
– n>m
– basic solutions  set n−m variables equal to zero
n n!
– Maximum number of basic solutions: Cm = m! n−m !

– basic solutions correspond to corner points in graphical


solution space.

7
From Graphical to Algebraic Solution
• Consider the problem:

Maximize:
z = 2x1 + 3x2
subject to
2x1 + x2 ≤ 4
x1 + 2x2 ≤ 5
x1 , x2 ≥ 0

8
From Graphical to Algebraic Solution
Maximize:
z = 2x1 + 3x2
subject to
2x1 + x2 + s1 = 4
x1 + 2x2 + s2 = 5
x1 , x2 , s1 , s2 ≥ 0

Clearly n = 4 and m = 2
⇒ Maximum basic solutions = 6 (note corner points are 4)

9
10
From Graphical to Algebraic Solution
• Which n−m variables should be set equal to zero to
target a specific corner point?
n
– target all basic solutions: Cm points

– problem size increases  enumerating all corner points


becomes expensive  simplex algorithm.
11
Simplex Method

12
Simplex Method
• Investigate only a “select few” basic solutions.
• Iterations are required…
• Example:
Maximize:
z = 2x1 + 3x2
subject to
2x1 + x2 ≤ 4
x1 + 2x2 ≤ 5
x1 , x2 ≥ 0

13
Simplex Method
Step 1: Convert to standard form
Maximize:
z = 2x1 + 3x2
subject to
2x1 + x2 + s1 = 4
x1 + 2x2 + s2 = 5
x1 , x2 , s1 , s2 ≥ 0

Clearly n = 4 and m = 2

14
15
Simplex Method
• Iteration #1
– Start at the origin: all decision variables are zero.
– x1 = 0, x2 = 0 ⇒ s1 = 4, s2 = 5
– z=0
– check whether an increase in the values of non-basic
(variables that are zero) x1 and x2 above their current values
can improve (increase) the value of z  investigate the
objective function (z)  increase in x1 or x2 (or both) will
increase z.
– prepare for next iteration

16
Simplex Method
• Simplex method doesn’t allow simultaneous increases in
variables  targets one variable at a time.
• The variable to increase: one with largest rate of
improvement in z.

z = 2x1 + 3x2

• Elect to increase x2

17
Simplex Method
• x2 must be increased until corner point B is reached

18
Simplex Method
• x2 must be increased until corner point B is reached

𝟏𝟓 𝟏 𝟑
𝐁: 𝐳 𝐱𝟏 , 𝐬𝟐 = + 𝐱 𝟏 − 𝐬𝟐
𝟐 𝟐 𝟐

𝐀: 𝐳(𝐱𝟏 , 𝐱𝟐 ) = 𝟐𝐱𝟏 + 𝟑𝐱𝟐

19
Simplex Method
• Iteration #2
– Reached point B.
– x1 = 0, x2 = 2.5 ⇒ s1 =? , s2 = 0
15
– z= 2
– x2 is now basic variable (entered the solution), while s2 is non-
basic (exited the solution).
– prepare for next iteration.

20
Simplex Method
• x1 must be increased until corner point C is reached

𝟏𝟓 𝟏 𝟑
𝐁: 𝐳 𝐱𝟏 , 𝐬𝟐 = + 𝐱 𝟏 − 𝐬𝟐 𝟏 𝟒
𝟐 𝟐 𝟐 𝐂: 𝐳 𝐬𝟏 , 𝐬𝟐 = 𝟖 − 𝐬 𝟏 − 𝐬𝟐
𝟑 𝟑

𝐀: 𝐳(𝐱𝟏 , 𝐱𝟐 ) = 𝟐𝐱𝟏 + 𝟑𝐱𝟐

21
Simplex Method
• Iteration #3
– Reached point C.
– x1 = 1, x2 = 2 ⇒ s1 =? , s2 =?
– z=8
– x1 is now basic variable (entered the solution), while s1 is non-
basic (exited the solution).
– Iterations complete.

22
Simplex Method
• How point F can be discarded without looking at the
graph?
𝐅: 𝐳 𝐱𝟏 , 𝐬𝟏 = 𝟏𝟐 − 𝟒𝐱𝟏 − 𝟑𝐬𝟏

𝟏𝟓 𝟏 𝟑
𝐁: 𝐳 𝐱𝟏 , 𝐬𝟐 = + 𝐱 𝟏 − 𝐬𝟐
𝟐 𝟐 𝟐 𝟏 𝟒
𝐂: 𝐳 𝐬𝟏 , 𝐬𝟐 = 𝟖 − 𝐬𝟏 − 𝐬𝟐
𝟑 𝟑

𝐀: 𝐳(𝐱𝟏 , 𝐱𝟐 ) = 𝟐𝐱𝟏 + 𝟑𝐱𝟐

23
Simplex Method
• Always connects corner points.
• Path to optimum: ABC.
• Each corner point along path is associated with an
iteration.
• Method always moves alongside edges of solution
space  method doesn’t cut across solution space.
• Cannot go from A to C directly.

24
10th ed. 3-18, 9th ed. set 3.3A (Q. 3)
Consider the three-
dimensional LP solution
space, whose feasible
extreme points are A, B, . . .
, and J.
(a) Which of the following
pairs of corner points
cannot represent successive
simplex iterations: (A, B),
(H, I ), (E, H ), and (A, I )?
Explain why.

25
10th ed. 3-18, 9th ed. set 3.3A (Q. 3)
(b) Suppose that simplex
iterations start at A and that
optimum occurs at H.
Indicate whether any of the
following paths are not
legitimate for the algorithm,
and state the reason.
(i) AB GH
(ii) ACIH
(iii)ADFCABG
H
26
10th ed. 3-20, 9th ed. set 3.3A (Q. 5)
For each of the given objective
functions and the solution space,
select the non-basic variable that
leads to the next simplex corner
point, and determine the associated
improvement in z.
(a) Maximize 𝐳 = 𝐱 𝟏 − 𝟐𝐱 𝟐 + 𝟑𝐱 𝟑
(b) Maximize 𝐳 = 𝟓𝐱 𝟏 + 𝟐𝐱 𝟐 + 𝟒𝐱 𝟑
(c) Maximize 𝐳 = −𝟐𝐱 𝟏 + 𝟕𝐱 𝟐 + 𝟐𝐱 𝟑
(d) Maximize 𝐳 = 𝐱 𝟏 + 𝐱 𝟐 + 𝐱 𝟑

27
Simplex
Computations

28
Simplex Computations
Reddy Mikks model
Maximize:
z = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4
subject to
6x1 + 4x2 + s1 + 0s2 + 0s3 + 0s4 = 24
x1 + 2x2 + 0s1 + s2 + 0s3 + 0s4 = 6
−x1 + x2 + 0s1 + 0s2 + s3 + 0s4 = 1
0x1 + x2 + 0s1 + 0s2 + 0s3 + s4 = 2
x1 , x2 , s1 , s2 , s3 , s4 ≥ 0

Clearly n = 6 and m = 4
29
Simplex Tableau
• Starting Simplex Tableau (starts at origin)
z − 5x1 − 4x2 = 0
Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 −5 −4 0 0 0 0 0
s1 row 0 6 4 1 0 0 0 24
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2

• Do we have a maxima?
30
Entering Variable
• Increase x1 (most positive objective coefficient)
or
• Simplex tableau: select non-basic variable with most
negative coefficient in objective equation (simplex
optimality condition).

• x1: entering variable because it enters basic solution.


• One basic variables must leave  becomes zero.

31
Leaving Variable
• Compute ratios of the right-hand side of equations
(Solution column) to corresponding (strictly) positive
constraint coefficients under the entering variable (x1).
Basic Entering x1 Solution Ratio (intercept)
24
s1 row 6 24 x1 = = 4 → minimum
6
6
s2 row 1 6 x1 = = 6
1
1
s3 row −1 1 x1 = = −1 (ignore)
−1
2
s4 row 0 2 x1 = = ∞ (ignore)
0
32
Leaving Variable
Basic Entering x1 Solution Ratio (intercept)
24
s1 row 6 24 x1 = = 4 → minimum
6
6
s2 row 1 6 x1 = = 6
1
1
s3 row −1 1 x1 = = −1 (ignore)
−1
2
s4 row 0 2 x1 = = ∞ (ignore)
0
Conclusion: x1 enters (x1 = 4) and s1 leaves (s1 = 0)

Minimum Ratio Test (MRT)


33
Leaving Variable
How do the computed ratios determine the leaving
variable and the value of the entering variable?

34
35
Leaving Variable
How do the computed ratios determine the leaving
variable and the value of the entering variable?
• Computed ratios are actually the intercepts of the
constraint lines with the (entering variable) x1-axis.
• x1 must be increased to smallest nonnegative intercept
with the x1-axis (= 4) to reach corner point B.
• Point B: s1 associated with constraint equals zero 
leaving variable (simplex feasibility condition) 
guarantees feasibility of new solution.

36
New Feasible Basic Solution
• Solution point B determined by “swapping” entering
variable x1 and leaving variable s1 in simplex tableau.
• Swapping using Gauss-Jordan row operations
Pivot element
Enter
Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 −5 −4 0 0 0 0 0
Leave s row 0 6 4 1 0 0 0 24
1
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2

37
Gauss-Jordan row operations
1. Pivot row
– Basic column: leaving variable replaced with entering variable.
Current pivot row
– New pivot row =
Pivot element

Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 −5 −4 0 0 0 0 0
x1 row 0 6/6 4/6 1/6 0 0 0 24/6
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2
38
Gauss-Jordan row operations
1. Pivot row
– Basic column: leaving variable replaced with entering variable.
Current pivot row
– New pivot row =
Pivot element

Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 −5 −4 0 0 0 0 0
x1 row 0 1 2/3 1/6 0 0 0 4
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2
39
Gauss-Jordan row operations
2. Other rows (including z)
– New row = Current row − (Pivot column coefficient) ×
(New pivot row)

Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 −5 −4 0 0 0 0 0
x1 row 0 1 2/3 1/6 0 0 0 4
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2
40
Gauss-Jordan row operations
2. Other rows (including z)
– New z-row = Current z-row −(−5)×(New x1-row)
= (1, −5, −4, 0, 0, 0, 0, 0, 0) −(−5)×(0, 1, 2/3, 1/6, 0, 0, 0, 4)
= (1, 0, −2/3, 5/6, 0, 0, 0, 20)

Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 0 −2/3 5/6 0 0 0 20
x1 row 0 1 2/3 1/6 0 0 0 4
s2 row 0 1 2 0 1 0 0 6
s3 row 0 −1 1 0 0 1 0 1
s4 row 0 0 1 0 0 0 1 2
41
New Simplex Tableau
Basic z x1 x2 s1 s2 s3 s4 Solution
z row 1 0 −2/3 5/6 0 0 0 20
x1 row 0 1 2/3 1/6 0 0 0 4
s2 row 0 0 4/3 −1/6 1 0 0 2
s3 row 0 0 5/3 1/6 0 1 0 5
s4 row 0 0 1 0 0 0 1 2
• New tableau structure similar to that of starting tableau
– constraint coefficients of basic variable form an identity
matrix.
– non-basic variables (x2, s1) are zero  solution-column yields
new basic solution (x1 = 4, s2 = 2, s3 = 5, s4 = 2)
– This “conditioning” is due to Gauss-Jordan row operations.
42
Thank you!

43

You might also like