simplex method
simplex method
Ganesh Thapa
Simplex Method
• The graphical approach can be used for two-variable LP problems
1st - transform all the constraints to equality by introducing slack, surplus, and
artificial variables as follows:
≥ + slack (s)
= + Artificial (A)
Simplex Method - Formulation
The Simplex algorithm is an algebraic procedure to solve LP problems based on geometric
concepts that must be translated into algebraic language to allow solving systems of equations.
1st - transform all inequalities into equalities by introducing one additional variable to
each constraint (the slack variables: S1, S2, S3).
and x1 x2 S1 S2 S3 ≥ 0 and x1 x2 S1 S2 S3 ≥ 0
Try for it
Max: Z = 3 x1 + 5 x2
Max: Z = 3 x1 + 5 x2 Subject to:
Subject to: x1 +S1 = 4
x1 ≤ 4 2 x2 + S2 = 12
2 x2 ≤ 12 3x1 + 2x2 + S3 = 18
3x1 + 2x2 ≤ 18 and x1 , x2 ,S1,S2 ≥ 0
and x1 , x2 ≥ 0
Min Z =2 X1 + 3 X2 …..
Min Z =2 X1 + 3 X2
S.t.
S.t.
½ X1 + ¼ X2 + S1 = 4
½ X1 + ¼ X2 ≤ 4
X1 + 3X2 –S2 + A1 = 20
X1 + 3X2 20
X1 + X2 +A2 = 10
X1 + X2 = 10
X1, X2 0
X1, X2 0
Simplex Method - Formulation
The Simplex algorithm is an algebraic procedure to solve LP problems based on geometric
concepts that must be translated into algebraic language to allow solving systems of equations.
1st - transform all inequalities into equalities by introducing one additional variable to each
constraint (the slack variables: S1, S2, S3).
2nd - build the Simplex tabular form where only the essential information is recorded.
1st - transform all inequalities into equalities by introducing one additional variable to each
constraint (the slack variables: S1, S2, S3).
2nd - build the Simplex tabular form where only the essential information is recorded.
1st - transform all inequalities into equalities by introducing one additional variable to
each constraint (the slack variables: S1, S2, S3).
2nd - build the Simplex tabular form where only the essential information is recorded
Coff. BV Cj 90 120 0 0 0
BV Each basic feasible solution has basic or non-
basic variables
CB XB b X1 X2 S1 S2 S3 Ratio
0 S1 40 1 0 1 0 0 - non-basic variables are set to ZERO
0 S2 50 0 1 0 1 0 - basic variables are directly obtained from
0 S3 180 2 3 0 0 1 the table having coefficient 0 or 1
Zj
Zj - Cj initialize the procedure setting x1 = x2 = 0
Non-basic Basic
variables variables (X1, X2, S1, S2, S3 ) =( 0, 0, 40, 50, 180)
Simplex Method - Graphical analysis
• The Simplex algorithm is a search procedure that:
- shifts through the set of basic feasible solutions, one at a time, until the optimal
basic feasible solution (whenever it exists) is identified.
- the method is an efficient implementation the Corner Points Procedure.
Optimality check:
The current BFS is optimal (in a No Find another feasible solution
max LP) if every coefficient in
Row Zj - Cj is ≥ 0. Entering variable: Choose the entering variable (in a max problem) to be
the NBV with the most negative coefficient in Row Zj - Cj .
Yes
Leaving BV: apply minimum ratio test - identify the row with the smallest
+ve ratio RHS /aij (the most restrictive Row); the BV for this row is the
leaving BV (it becomes nonbasic).
Apply Gauss-Jordan elimination procedure to solve the system of linear
equations.
CB XB b X1 X2 S1 S2 S3 Ratio
0 S1 40 1 0 1 0 0 Undefined Find another feasible solution
0 S2 50 0 1 0 1 0 50
0 S3 180 2 3 0 0 1 60
Zj 0 0 0 0 0 Entering variable: variable (in a max problem)
Zj - Cj -90 -120 0 0 0 to be the NBV with the most negative
coefficient in Row Zj - Cj . = X2 (aij )
Leaving BV: apply minimum ratio test - identify the row with
the smallest +ve ratio b/aij (the most restrictive Row); = S 2
CB XB b X1 X2 S1 S2 S3 Ratio
0 S2 50/3 0 0 0 1 -1/3
120 X2 100/3 0 1 0 0 1/6 Optimal feasible solution found – STOP
90 X1 40 1 0 0 0 0 SIMPLEX
Zj 90 120 0 0 20
Zj - Cj 0 0 0 0 20
Max: Z = 90 x1 + 120 x2
X1 = 40
Subject to: 100/3
X2 =
x1 + S1 ≤ 40 0
S1 =
x2 + S2 ≤ 50 S2 = 16.67
2x1 + 3x2 + S3 ≤ 180 S3 = 0
and x1 x2 S1 S2 S3 ≥0 Z= 7600
Simplex Method –Example 2
• Max: Z = 3 x1 + 5 x2 • Max: Z = 3 x1 + 5 x2
Subject to: Subject to:
x1 ≤ 4 x1 + S1 = 4
2 x2 ≤ 12 2 x2 + S2 = 12
3x1 + 2x2 ≤ 18 3x1 + 2x2 + S3 = 18
and x 1 , x2 ≥ 0 and x1 , x2, S1 , S2, S3 ≥ 0
Coff.B BV Cj 3 5 0 0 0
V
CB XB b X1 X2 S1 S2 S3 Ratio
0 S1 4 1 0 1 0 0
0 S2 12 0 2 0 1 0
0 S3 18 3 2 0 0 1
Zj 0 0 0 0 0
Zj - Cj -3 -5 0 0 0