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

L4 5 6 7 SimplexMethod

Uploaded by

Harsh Kumar
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 views45 pages

L4 5 6 7 SimplexMethod

Uploaded by

Harsh Kumar
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/ 45

Lecture 4, 5, 6 & 7:

Simplex Method
1. LP Model in Equation Form
• LP Model in Equation Form
• Two requirements

• Converting Inequalities into Equations with Nonnegative RHS


• Slack Variable

• Surplus Variable

• Nonnegative RHS
LP Model in Equation Form
• Unrestricted Variable

• Example

• m = 2 equations and n = 4 variables


• Corner points can be found by putting n-m = 2 variables zero.
2. Transition from Graphical to Algebraic Solution
• Put x1 = 0, x2 = 0, and s1=4, s2 = 5 Point A
F
• Put s1=0, s2=0, and x1 = 1, x2 = 2 Point C

• Basic variables = m,
B C
• Nonbasic variables = n-m

A D E

Maximum number of corner points

If m = 10, n = 20, then 184,756 corner


points
Simplex Method
• Selectively investigate few corner points and locate the optimum
solution
• Reddy Mikks Model

• Rewrite objective function


Transition from Graphical to Algebraic Solution
Basic z x1 x2 s1 s2 s3 s4 Solution Ratio
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2
3. Simplex Tableau
• Entering variable
• Which nonbasic variable (x1 or x2) should enter such that the objective
function should improve maximally?
• Most negative coefficient of the maximization objective function
• Optimality condition

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

Entering variable x1
Simplex Tableau
• Leaving variable
• Minimum nonnegative ratio of RHS of the equation
to the corresponding constraint coefficient under
the entering variable
• Feasible condition

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24 24/6=4
s2 0 1 2 0 1 0 0 6 6/1=6
s3 0 -1 1 0 0 1 0 1 1/-1=-1
s4 0 0 1 0 0 0 1 2 2/0
Leaving
Variables
s1
Simplex Tableau

Pivot element

Entering
Variable

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 -5 -4 0 0 0 0 0
Leaving Pivot
s1 0 6 4 1 0 0 0 24
variable row
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

Pivot
column
Gauss-Jordon Row Operation

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 -5 -4 0 0 0 0 0
Pivot
x1 0 6
1 2/3
4 1
1/6 0 0 0 24
4
row
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

• Pivot element = 6
Gauss-Jordon Row Operation

• For row z: current row coefficient (1, -5, -4, 0, 0, 0, 0, 0);


pivot column coefficient= -5;
new pivot row coefficient (0, 1, 2/3, 1/6, 0, 0, 0, 4)

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 -5 -4 0 0 0 0 0
x1 0 1 2/3 1/6 0 0 0 4
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

• New z-row is (1, 0, -2/3, 5/6, 0, 0, 0, 20)


Gauss-Jordon Row Operation

• For row s2: current row coefficient (0, 1, 2, 0, 1, 0, 0, 6);


pivot column coefficient= 1;
new pivot row coefficient (0, 1, 2/3, 1/6, 0, 0, 0, 4)

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 0 -2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

• For row s2: new row (0, 0, 4/3, -1/6, 1, 0, 0, 2)


Gauss-Jordon Row Operation

• For row s3: current row coefficient (0, -1, 1, 0, 0, 1, 0, 1);


pivot column coefficient= -1;
new pivot row coefficient (0, 0, 1, 2/3, 1/6, 0, 0, 0, 4)

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 0 -2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 -1/6 1 0 0 2
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

• For row s3: new row (0, 0, 5/3, 1/6, 0, 1, 0, 5)


Gauss-Jordon Row Operation

• For row s4: current row coefficient (0, 0, 1, 0, 0, 0, 1, 2);


pivot column coefficient= 0;
new pivot row coefficient (0, 0, 1, 2/3, 1/6, 0, 0, 0, 4)

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 0 -2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 -1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2

• For row s3: new row (0, 0, 1, 0, 0, 0, 1, 2)


Simplex Tableau
• 1st iteration is over

Entering variable: Most negative coefficient


for maximization problem

Leaving variable: minimum nonnegative ratio

Basic z x1 x2 s1 s2 s3 s4 Solution Ratio


z 1 0 -2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4 6
s2 0 0 4/3 -1/6 1 0 0 2 3/2
s3 0 0 5/3 1/6 0 1 0 5 3
s4 0 0 1 0 0 0 1 2 2
Pivot Row and Column

• Gauss-Jordon Row
operations
Simplex Tableau
Any entering
Variable?
Constraints
Steps of Simplex Method
Optimality condition
Maximization problem Minimization problem
Most negative coefficient of nonbasic variable Most positive coefficient of nonbasic variable
Feasibility condition
Smallest nonnegative ratio Smallest nonnegative ratio
Steps of Simplex Method
4. Artificial Starting Solution
• Constraints are (≤) with nonnegative right hand sides offers a
convenient all-slack starting basic feasible solution.
• Models with ≥ or = constraints do not.
• Artificial Variable: Starting “ill-behaved” LPs with ≥ or = constraints
is to use artificial variable that play the role of slacks at the first
iteration, and then dispose them legitimately at a later iteration.
• Two methods
• M-method
• Two phase method
M-Method
• Use x3 surplus with constraint 2 and slack variable x4 with
constraint 3

• Constraint 1 and constraint 2 do not have slack variable


• Add artificial variable R1 and R2 and penalize them in the objective
function
M-Method
Z – 4x1 – x2 –MR1 –MR2 = 0

Minimization problem:
Add MRi

• Basic variables: (R1, R2, x4)


• What should be the value of M?
• It should be large enough relative to the original objective coefficient
• For the given problem, M = 100
M-Method
Inconsistency:
Basic x1 x2 x3 R1 R2 x4 Solution
Non zero
Z -4 -1 0 -100 -100 0 0 coefficient
R1 3 1 0 1 0 0 3 of R1 and R2
R2 4 3 -1 0 1 0 6
x4 1 2 0 0 0 1 4

• Substitution such that coefficient of R1 and R2 becomes zero


• For the given problem:
M-Method
Pivot column

Minimization Basic x1 x2 x3 R1 R2 x4 Solution Ratio


problem Z 696 399 -100 0 0 0 900
Pivot row R1 3 1 0 1 0 0 3 1
R2 4 3 -1 0 1 0 6 3/2
x4 1 2 0 0 0 1 4 4

• Apply simplex method steps


• Entering variable:
• x1 (most positive coefficient in z for minimization objective function)
• Leaving variable:
• R1 (Minimum nonnegative ratio)
M-Method
• Apply Gauss-Jordon row operations
Pivot column
Basic x1 x2 x3 R1 R2 x4 Solution Ratio
Z 0 167 -100 -232 0 0 204
x1 1 1/3 0 1/3 0 0 1 3
Pivot row R2 0 5/3 -1 -4/3 1 0 2 6/5
x4 0 5/3 0 -1/3 0 1 3 9/5

• Entering variable: x2
• Leaving variable: R2
M-Method
• Apply Gauss-Jordon row operations
Pivot column
Basic x1 x2 x3 R1 R2 x4 Solution Ratio
Z 0 0 1/5 -492/5 -501/5 0 18/5
x1 1 0 1/5 3/5 -1/5 0 3/5 3
x2 0 1 -3/5 -4/5 3/5 0 6/5 -2
Pivot row x4 0 0 1 1 -1 1 1 1

• Entering variable: x3
• Leaving variable: x4
M-Method
• Apply Gauss-Jordon row operations
Any entering
Variable?
Basic x1 x2 x3 R1 R2 x4 Solution
Z 0 0 0 -493/5 -100 -1/5 17/5
x1 1 0 0 2/5 0 -1/5 2/5
x2 0 1 0 -1/5 0 3/5 9/5
x3 0 0 1 1 -1 1 1

• x1 = 2/5, x2 = 9/5 and z = 17/5


Two Phase Method
• M-method uses penalty M
• Possibility of round-off error that may impair the accuracy of simplex
calculations
• Two phase method
• Phase I attempts to find starting basic feasible solution
• Phase II is invoked to solve the original problem
• Problem solved in the last section
Phase-I of Two Phase Method

• Simplex tableau

Inconsistence
Phase-I of Two Phase Method
• Substitution

• Apply simplex steps and Gauss-Jordon row operation


• The optimum solution of Phase I is

• r=0, basic feasible solution x1 = 3/5, x2 = 6/5, x4 = 1


• Eliminate columns of artificial variables for Phase II
Phase-II of Two Phase Method
• Phase II problem

• Simplex tableau
Phase-II of Two Phase Method
• Substitution to make coefficient of basic variables x1 and x2 zero

• Simplex tableau

• Apply simplex method steps and Gauss-Jordon row operation to


include x3
• Widely used method.
Phase-II of Two Phase Method
5. Special Cases in Simplex Method
• Degeneracy
• Alternative Optima
• Unbounded Solution
• Nonexistence (or infeasible) solution
Degeneracy
• A tie at minimum ratio (leaving variable)
• Choose arbitrarily
• One basic variable become zero in the next iteration (Degeneracy)
• One constraint is redundant
• Example Equation form
z – 3x1 – 9x2 = 0

x1 + 4x2 + x3 = 8
x1 + 2x2 + x4 = 4
x1, x2 ≥ 0

• Use x3 and x4 as slack variables


Degeneracy

Ratio

8/4=2
Tie
4/2=2

Cycling
0 Or
Circling

• Can we stop at iteration 1? No.


• Temporally degenerate
Degeneracy

• Overdetermined
• Superfluous resources
Alternate Optima
• Objective function is parallel to nonredundant binding constraint
• Binding constraint: A constraint that is satisfied as an equation at
the optimal solution.
• Example
Alternate Optima

0
• Already get the optima
• Point B in graph

0 • Optima
• Point C in graph
• Nonzero x1

• All solutions along line BC are optimal.


Unbounded Solution
• Objective function value keeps on improving infinitely without
violating any constraint
• At least one variable is unbounded
• Leads to the conclusion that the model is poorly constructed
• Example

2x1 ≤ 40
Unbounded Solution
Iteration Basic X1 X2 X3 X4 Solution Ratio
0 Z -2 -1 0 0 0
X1 enters X3 1 -1 1 0 10 10
X3 leaves
X4 2 0 0 1 40 20
1 Z 0 -3 2 0 20
X2 enters X1 1 -1 1 0 10
X4 leaves
x4 0 2 -2 1 20 10
2 Z 0 0 -1 3/2 50
X3 enters X1 1 0 0 1/2 20 20/0
No leaving
variable X2 0 1 -1 1/2 10 10/-1

• All constraint coefficients under x3 are either 0 or negative


• Means no leaving variable and that x3 can be increased infinitely without
violating any constraints.
• Unbounded problem.
Infeasible Solution
• LP model with inconsistence constraints has no feasible solution.
• This situation will never occur for ≤ type constraints because we
can start with slack variables as our basic feasible solutions.
• For other type of constraints, we use artificial variables
• These artificial variables are forced to become zero at the optima if the
model has feasible solution.
• Otherwise at least one artificial variable will be positive in the optimum
iteration
Infeasible Solution
• Example

• Using M-method with M = 100

4
Infeasible Solution
• By allowing R to be positive, the simplex method in essence, has
reversed the direction of the inequality from

• The result is pseudo-optimal solution.

You might also like