Download as pdf or txt
Download as pdf or txt
You are on page 1of 66

Intended Learning Outcomes

1.Solve linear programming using


excel.
2. Discuss simplex method
3. Perform computer solution and
compare with the graphing
solution.
Introduction to Linear
Programming
▪ Introduction Computer Solution
▪ Solve sample problems using simplex
▪ Solve sample problems using computer solution
▪ Clarifications (if there is any)
▪ Answer the question in the discussion
▪ Submit seatwork.
When linear programming was first developed in the
1940s, virtually the only way to solve a problem was by
using a lengthy manual mathematical solution procedure
called the simplex method.

However, during the next six decades, as computer


technology evolved, the computer was used more and
more to solve linear programming models. The
mathematical steps of the simplex method were simply
programmed in prewritten software packages designed for
the solution of linear programming problems.
Simplex method is a procedure involving a set of
mathematical steps to solve linear programming
problems.
▪ As a result of the easy and low-cost
availability of personal computers and linear
programming software, the simplex method
has become less of a focus in the teaching of
linear programming. Thus, at this point in our
presentation of linear programming, we focus
exclusively on computer solution.
LINEAR
PROGRAMMING

The Simplex
Method
Steps in Solving LP Problems by the
Simplex Method

1. Represent the unknown by the


basic variables x1,x2,…xn (any letter
can be used indicating the units).
Steps in Solving LP Problems by the
Simplex Method

2. State the objective function,


usually maximizing profit or
minimizing cost and set up the
algebraic expressions describing
the problem constraints with proper
inequality or equality signs.
Steps in Solving LP Problems by the
Simplex Method

3. Convert the constraints to a


new program or equality
constraints following the rules:
For Maximization Problem:

1. If the symbol is ≤, then add


slack variable Sj to the left side
then change the sign to equality
(=) sign.
For Maximization Problem:

2. If the symbol is =, then add


slack variable Sj to the left
hand side and retain the
equality sign.
For Maximization Problem:

3. If the symbol is ≥, multiply


both sides by -1, symbol will
be changed to ≤, add slack
variable to the left side and
change the sign to equality
(=).
For Minimization Problem:

1. If the symbol is ≤, then add


a slack variable Sj to the left
side of the inequality and
change the sign to =.
For Minimization Problem:

2. If the symbol is =, then add


an artificial variable Aj to the
left side of the equality and
retain the = sign.
For Minimization Problem:

3. If the symbol is ≥, then


subtract surplus variable Sj
but add an artificial variable Aj
on the left side and change
the sign to =.
Example 1:
A firm that produces two products has
limitations on machine and labor time. There
are 240 hours of machine time and 300 hours
of labor time available during the production
period. A unit of the first product requires 4
hours of machine time and 3 hours of labor
time. The second product takes 6 and 8
hours of machine and labor time respectively.
A unit of 1 and 2 generates profits of P10.00
and P20.00 respectively. The problem is to
find the number of units of products 1 and 2
to produce to maximize profit.
Setting the program:
Let ;
X1 = number of units of products 1 to
produce per production period
X2 = number of units of products 2 to
produce per production period

Objective function : Maximize Z = 10X1 +


20X2

Subject to : 4X1 + 6X2 ≤ 240


3X1 + 8X2 ≤ 300
X1 ≥ 𝟎
Let ;

X1 = number of units of products 1 to produce per


production period
X2 = number of units of products 2 to produce per
production period

Objective function : Maximize Z = 10X1 + 30X2

Subject to : 4X1 + 6X2 ≤ 240


3X1 + 8X2 ≤ 300
X1 ≥ 𝟎
X2 ≥ 𝟎
Programming for Simplex Method :

4X1 + 6X2 + S1 = 240


3X1 + 8X2 + S2 = 300

X1 ≥ 𝟎
X2 ≥ 𝟎
S1 ≥ 𝟎
S2 ≥ 𝟎

Z = 10X1 + 20X2 + 0S1 + 0S2


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
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 ;

X1 = number of units of products 1 to produce per


production period
X2 = number of units of products 2 to produce per
production period

Objective function : Maximize Z = 10X1 + 20X2

Subject to : 4X1 + 6X2 ≤ 240


3X1 + 8X2 ≤ 300
X1 ≥ 𝟎
X2 ≥ 𝟎
Maximize Z = 10x + 20 y
A (8.57, 34.29) ; Z = 771.41

(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.

Minimize Z = $3,000 x1 + $1000 x2


Subject to:
60x1 + 20x2 ≥ 1,200
10 x1 + 10x2 ≥ 400
40x1 + 160 x2 ≥ 2,400
x1, x2 ≥ 0
• A (0, 60)

• B (10, 30)

𝟏𝟎𝟎 𝟐𝟎
• C ( , )
𝟑 𝟑
• D (60, 0)
Minimize Z = $3,000 x1 + $1000 x2

• A (0, 60) ; Z = $60,000

• B (10, 30) ; Z = $60,000


𝟏𝟎𝟎 𝟐𝟎
C ( , ) ; Z = $106,666.67
𝟑 𝟑

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

Minimize Z = $3,000 x1 + $1000 x2


Subject to:
60x1 + 20x2 ≥ 1,200
10 x1 + 10x2 ≥ 400
40x1 + 160 x2 ≥ 2,400

You might also like