Linear Programming Computer Solution
Linear Programming Computer Solution
The Simplex
Method
Steps in Solving LP Problems by the
Simplex Method
X1 ≥ 𝟎
X2 ≥ 𝟎
S1 ≥ 𝟎
S2 ≥ 𝟎
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Setting up the initial table:
Contribution to profit column
Variable column
Constraints column
Pj 10 20 0 0 Objective Coefficients
Prod Qty X1 X2 S1 S2 Variable Row
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1 Constraints
coef
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Determine the entering basic
variable by selecting the
variable, a non-basic variable,
with the largest value. Put a box
around the column and call this
the optimum column.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
Determine the entering basic
variable by selecting the optimal column
variable, a non-basic variable,
with the largest value. Put a box
around the column and call this
the optimum column.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
1. Pick out each
coefficient in the optimal column
optimum column that is
strictly positive.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
0 S2 300 3 8 0 1
Zj 0 10 20 0 0
Pj - Zj 0 10 20 0
2. Divide each of these
coefficients (the quantity optimal column
column) by the coefficient in
the pivot column entry for
the same row.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0 240÷ 6 = 40
0 S2 300 3 8 0 1 300 ÷ 8 = 37.5
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
3. Identify the row that has
the least/smallest of these optimal column
ratios.
(Disregard the row with 0
and (-) entries in the
optimum column)
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0 240 ÷ 6 = 40
0 S2 300 3 8 0 1 300 ÷ 8 = 37.5
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
4. The basic variable for that
row is the leaving basic optimal column
variable, so replace that variable
by entering basic variable in the
basic variable column of the
next simplex tableau.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
20 X2 300 3 8 0 1
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
4. Put a box around optimal column
this row and call this
the pivot row. pivot row
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
20 X2 300 3 8 0 1
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
4. Also call the optimal column
number that is in pivot number
both boxes the pivot
number.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
20 X2 300 3 8 0 1
Zj 0 0 0 0 0
Pj - Zj 0 10 20 0 0
5. Determine the pivotal row by dividing each
pivotal entries by the pivot number.
(300 3 8 0 1) ÷ 8
𝟕𝟓 𝟑 𝟏
1 0 New row or the
𝟐 𝟖 𝟖
Entering Row
(ER) in the next
tableau
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
6. Determine the new remaining rows.
This is done by taking the sum of the
entries from an old row and new pivot
row multiplied by the negative element
along the intersection of Optimum
Column and the Old Row which is
being evaluated. Notice that the
concept of reducing a matrix to
echelon form is partially performed
whenever we convert the column
entries to zero and one:
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
0 S1 240 4 6 1 0
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
Pj - Z j 0 10 20 0 0
6. Determine the new remaining rows. This is done by
taking the sum of the entries from an old row and new
pivot row multiplied by the negative element along the
intersection of Optimum Column and the Old Row
which is being evaluated. Notice that the concept of
reducing a matrix to echelon form is partially
performed whenever we convert the column entries to
zero and one:
Old Row (OR) = OR – 6 ER
240 4 6 1 0
9 3
225 6 0
4 4
7 3
15 0 1 -
4 4
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
𝟕 𝟑
0 S1 15 0 1 -
𝟒 𝟒
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
Zj 0 0 0 0 0
P -Z 0 10 20 0 0
Construct the next simplex tableu by entering the
values obtained from steps 5 and 6. Complete the
tableu by recalculating the Zj row and Cj – Zj row.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
𝟕 𝟑
10 S1 15 0 1 -
𝟒 𝟒
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖 𝟖
𝟏𝟓 𝟓
Zj 750 20 0
𝟐 𝟐
𝟓 𝟓
C -Z 0 0 −
If there is still a positive entry found in the last row, then go back
to steps 2 – 6. Otherwise if there is no positive entry found in the
Cj – Zj row, then the process steps for the final or optimum table
has been obtained. Notice that in this optimum tableu, the
product column entries and the quantity column entries reveal
the optimum solution, together with the desired objective.
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
𝟕 𝟔𝟎
0 S1 15 𝟕 0 1 −
𝟑
15 ÷ =
𝟒
𝟒 𝟒 𝟕
20 X2
𝟕𝟓 𝟑 1 0
𝟏 𝟕𝟓 𝟑
𝟐
𝟖
𝟖 ÷ = 100
𝟐 𝟖
Zj 750 𝟏𝟓 20 0
𝟓
𝟐
𝟐
C j - Zj
𝟓
𝟓 0 0 −
𝟐
𝟐
ER for the next tableu:
7 3 7
15 0 1 − ÷
4 4 4
𝟔𝟎 𝟒 𝟑
= 1 0 −
𝟕 𝟕 𝟕
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
10 X1
𝟔𝟎 𝟏 0
𝟒
−
𝟑
𝟕 𝟕 𝟕
𝟕𝟓 𝟑 𝟏
20 X2 1 0
𝟐 𝟖
𝟖
Zj 750 𝟏𝟓 20 0
𝟓
𝟐
𝟐
Cj - Zj
𝟓
𝟓 0 0 −
𝟐
𝟐
3
New R2 = OR2 - (ER)
8
60 4 3 3
1 0 −
7 7 7 8
𝟒𝟓 𝟑 𝟑 𝟗
= 𝟎 −
𝟏𝟒 𝟖 𝟏𝟒 𝟓𝟔
𝟕𝟓 𝟑 𝟏
1 0
𝟐 𝟖 𝟖
-
𝟒𝟓 𝟑 𝟑 𝟗
𝟎 −
𝟏𝟒 𝟖 𝟏𝟒 𝟓𝟔
𝟐𝟒𝟎 𝟑 𝟐
𝟎 𝟏 −
𝟕 𝟏𝟒 𝟕
Pj 10 20 0 0
Prod Qty X1 X2 S1 S2
𝟔𝟎 1 0
𝟒
-
𝟑
10 X1 𝟕 𝟕
𝟕
20 X2
𝟐𝟒𝟎 0 1 −
𝟑 𝟐
𝟕 𝟏𝟒 𝟕
Zj
𝟓𝟒𝟎𝟎 10 20
𝟏𝟎 𝟏𝟎
𝟕 𝟕 𝟕
Cj - Zj 0 −
𝟏𝟎
−
𝟏𝟎
0 𝟕 𝟕
Decisions:
𝟔𝟎
= 8.56 or 9 units of Product 1
𝟕
𝟐𝟒𝟎
= 34.29 or 34 units of Product 2
𝟕
𝟓𝟒𝟎𝟎
At a maximum profit of or
𝟕
P771.43
Let ;
(60, 0) ; Z = 600
C (𝟎, 𝟎) ; Z = 0
D (0, 37.5) ; Z = 750
Solve the following linear programming model
graphically and explain the solution result.
• B (10, 30)
𝟏𝟎𝟎 𝟐𝟎
• C ( , )
𝟑 𝟑
• D (60, 0)
Minimize Z = $3,000 x1 + $1000 x2
D (60, 0) ; Z = $180,000
Sample Problem #1.
Solve the following linear programming model
using computer solution (excel) then compare the
answer to graphical solution