Unit 2 Linear Programming
Unit 2 Linear Programming
UNIT
LINEAR
PROGRAMMING
KNOW?
Name: Date:
Course & Section: Result:
Let us find out how much you already know about this lesson. Choose the letter
that corresponds to your answer. Take note of the questions that you were not
able to answer correctly. Find the right answer as you go through this module.
1. Linear Programming is a
a. Constrained optimization c. The technique for economic
technique allocation of limited resources
b. Mathematical technique d. All of the above
2. A constraint in the linear programming model restricts
a. Value of a decision variable c. Use of the available resources
b. Value of an objective function d. All of the above
3. Constraints of a linear programming model represent
a. limitations c. Balancing limitations and
requirements
b. requirements d. All of the above
4. How many decision variables can be used in a graphical method?
a. 4 c. 2
b. 3 d. 1
5. What is the area bounded by the constraints?
a. Feasible region c. key region
b. Pivotal region d. None of the above
6. What is another term for key elements common to the incoming and outgoing
vector in the simplex method?
a. Artificial c. pivotal
b. slack d. surplus
7. What variable represents the amount by which solution value exceeds a
resource?
a. slack c. artificial
b. surplus d. None of the above
8. What variable represents unused resources and is added to the original
objective function with zero coefficients?
a. slack c. artificial
b. surplus d. None of the above
INTRODUCTION TO LINEAR
PROGRAMMING
OBJECTIVES:
Name: Date:
Course & Section: Result:
OBJECTIVES:
At the end of the lesson, you should be able to:
Formulation of LP Models
Steps for Formulating LPP
1. Identify the decision variables, if the problem is a maximization (P-profit) or
minimization (C- cost).
2. Write the objective function.
3. Formulate the constraints.
4. State the non-negativity constraints.
Example 1 :
Alpha Company manufactures two types of products Sam & Sung, and sells
them at a profit of $2 on type Sam and $3 on type Sung. Each product is processed
on 2 machines M & B. Type Sam, requires 1 minute of processing time on M and 2
minutes on B. Type Sung requires one minute on M &1 minute on B. The machine
M is available for not more than 6 hours and 40 minutes, while machine B is
available for 10 hours during any working day. Formulate the problem as LPP.
Solution:
Table 2.2.1. Showing the Time (in minutes) Available and the Profit
Subject to:
X1 + X2 400
Time availability constraints
2X1 +X2
600
X1 , X2 ≥ 0 Non-negativity constraints
Final Answer:
Example 2 :
A firm manufactures three types of products A, B and C. The profits are $3,
$2, and $4, respectively. The firm has two machines, and below is the required
processing time in minutes for each machine from the product.
MACHINE PRODUCT
A B C
GAMMA 4 3 5
PHI 3 2 4
Machine GAMMA and PHI have 4,000 and 4,500 machine minutes, respectively.
The company must manufacture 100 A's, 200 B's, and 50 C's but not more than 150 A's.
Formulate an LPP to maximize the profit.
Solution:
Let X1 be the type of product A
X2 be the type of product B
X3 be the type of product C
Example 3 :
The maximum amount available of crude A and B is 200 units and 150
units, respectively. Market requirements show that at least 100 units of
gasoline X and 80 units of gasoline Y must be produced. The profit per
production run from process I and process II are $300 and $400 respectively.
Formulate the above problem as LPP.
Solution:
Let X1 represent process I
X2 represent process II
Example 4 :
A city hospital has the following daily requirements of the nurses on duty at a
minimal level:
PERIOD CLOCK TIME MINIMAL NO. OF
(24 HRS.A DAY) NURSES REQUIRED
1 6 am – 10 am 2
2 10 am – 2 pm 7
3 2 pm – 6 pm 15
4 6 pm – 10 pm 8
5 10 pm – 2 am 20
6 2 am – 6 am 6
Nurses report to the hospital at the beginning of each period and work for 8
consecutive hours. They want to determine minimal number of nurses to be
employed so that there will be a sufficient number of nurses available for each
period. Formulate this as LP model by setting up appropriate constraints and
objective function.
Solution:
Let X1 be the no. of nurses working during period 1
X2 be the no. of nurses working during period 2
X3 be the no. of nurses working during period 3
X4 be the no. of nurses working during period 4
X5 be the no. of nurses working during period 5
X6 be the no. of nurses working during period 6
Minimize C = X1 + X2 + X3 + X4 + X5 + X6
Subject to:
X1 + X 2 ≥ 2
X2 + X 3 ≥ 7
X3 + X4 ≥ 15
X4 + X 5 ≥ 8
X5 + X6 ≥ 20
X6 + X 1 ≥ 6
X 1, X 2, X 3, X 4, X 5, X 6 ≥ 0
Name: Date:
Course & Section: Result:
LINEAR PROGRAMMING –
GRAPHICAL SOLUTION
OBJECTIVES:
function
Example 1 :
Solution:
x-intercept y - intercept
x + 7y = 35 ( 35 , 0) (0, 5)
x + 2y = 20 ( 20 , 0) (0, 10)
Step 3. Graph the lines and shade the area that satisfies each linear inequality. The
solution/feasible region is the intersection of the shaded areas.
10 x + 2y = 20
9
8
7
6
B5 (0,5) 2x + 14y = 70
4
3 D
2
1
0A C (20,0)
0 feas5ible 15 20 25 30 35 40
re1g0ion
The vertices of the feasible region are A (0, 0), B (0, 5), C (20, 0) and the point
of intersection of lines 2x + 14y = 70 and x + 2y = 20 which is D (14, 3).
Therefore the feasible region is "ABCD".
Step 5: Substitute the value of the vertices into the objective function.
Step 6: Since the objective function is maximization, we need to get the highest
value of the profit.
Example 2 :
Solution:
Minimize C = 6x + 9y
subject to 4x + 5y ≥ 40
6x + 3y ≥ 30 or 2x + y ≥ 10
2x + 5y ≥ 30
x, y ≥ 0
x - intercept y - intercept
4x + 5y = 40 (10 , 0) (0, 8)
2x + y = 10 ( 5 , 0) (0,10)
2x + 5y = 30 (15 , 0) (0, 6)
The vertex (5,20) was obtained as the point of intersection of the lines
3 3
4x + 5y = 40 and 6x + 3y = 30 and that the vertex (5, 4) was obtained as the point of
intersection of the lines 2x + 5y = 30 and 4x +5y = 40.
Step 3. Graph the lines and shade the area that satisfies each linear inequality. The
solution/feasible region is the intersection of the shaded areas.
A(0,10)
10
9
8
7
B (5,20)
6
3
5 3
4
3
2x + y = 10 C (5, 4)
2
1
0
0 2 4 6 8 10 12 14 1 6
D ( 1 5,
0)
4x + 5y = 40 2x + 5y = 30
The vertices of the feasible region are A(0, 10), B (5,20) , C (5,4) and D (15, 0)..
3 3
Step 5: Substitute the value of the vertex into the objective function.
Step 6: Since the objective function is Minimization, we need to get the lowest value
of the cost.
At $66, the minimum cost per day occurs if the patient takes 5 Brand X
capsules and 4 Brand Y capsules per day.
Name: Date:
Course & Section: Result:
LINEAR PROGRAMMING:
THE SIMPLEX METHOD
OBJECTIVES:
Explain the meaning of the word “simplex” and the logic of using
simplex method
Convert LPP into its standard form by adding slack, surplus and
artificial variables
Solve and find the optimum solution of LPP using simplex method
Simplex Method is one of the most powerful & known methods for linear
programming. It is an iterative procedure for getting the most feasible solution. It
involves an iteration of one basic feasible solution to another. An initial simplex
tableau will be constructed out of different kinds of variables together with their
coefficients from the modified set of equality constraints, which is called the new
program of equality constraints. This tabular presentation of the solution is derived
from the concept of reducing the augmented and elementary matrices to its echelon
form.
4. The basic variables, usually denoted by X₁, X₂, …. , Xn, represents the
product mix; or i.e., the desired units that will yield an optimum or feasible
solution.
5. The slack variables, denoted by S₁, S₂, … , Sj, represent the unused
resources or the surplus and, therefore, these will demonstrate negligible or
zero profit cost contribution.
6. The artificial variables, denoted by A₁, A₂, …, Aj, represent the most
expensive resources substitutes; thus, they will demonstrate the highest cost
contribution to the objective function. It is suggested that the students will use
any of the powers of 10 (e.g., 10, 100, 1,000, 10,000…) for the coefficient of
A, in the objective function as long as it is the highest among the given
coefficients of the variables.
If the symbol is “≤”, then add slack variables Sj to the left side then
change the sign to equality “=”.
If the symbol is “=”, then add slack variables, Sj, to the left hand side
and retain the equality “=” sign.
If the symbol is ‘’≥’’ then multiply both sides by (-1), add slack variable.
Sj, to the left side and change the sign to “=”.
If the symbol is ≤, then add slack variables Sj to the left-hand side and
change the sign to “=”.
If the symbol is “=”, then add artificial variables Aj to the left-hand side
and retain the “=” sign.
If the symbol is “≥”, then subtract surplus variables Sj but add artificial
variable on the left side and change the sign to “=”.
Step 2. Tabulate the data into the first iteration of Simplex Method
S2
Zj
Pj - Z j
Step 3. Determine the entries for Zj row and (Pj – Zj) row for a maximization
problem and every variable column entry. Zj row entries are obtained by
taking the sum of the products of P j column entries (Cj column entries for a
minimization problem) and every variable column entries. P j row entries are
obtained by subtracting the Zj row entries from Pj row entries (Cj row entries
for a minimization problem).
Step 4. Determine the entering variable of the optimum column, i.e., the
column with the highest positive entry of P j – Zj row. Encircle the optimum
column. (For minimization problem, choose the column with the most negative
entry of Cj – Zj row).
Step 5. Determine the outgoing variable of the pivot row, i.e., the row with
least positive quotient between quantity column entries and optimum column
entries. Encircle the pivot row.
Step 6. Determine the New Pivotal Row (NPR) by dividing each pivotal row
with the pivot element. This pivot element is the entry along intersections of
pivot row and optimum column. Encircle the New Pivot Row.
Step 7. 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 of an
element along the intersection of Optimum Column and the Old Row, which is
being evaluated.
where:
R = Row
e = Pivot element
NPR = New Pivot Row
Step 8. Construct the next tableau by entering the values obtained from Steps
6 and 7. If there is no positive entry found on the Pj – Zj row, then the process
stops for the final or optimum table has been obtained. For the minimization
problem, an optimum table is obtained if there is no negative entry found on
the Cj – Zj row.
Example 1:
Adding the slack variables S1 and S2 and modifying the objective function, the
new program of constraints will be
Subject to x + y + S1 = 6
2x + y + S2 = 8
x≥0
y≥0
S1 ≥ 0
S2 ≥ 0
Steps 2 and 3: The initial simplex tableau. Determine the entries for Zj row and (Pj –
Zj) row for a maximization problem and every variable column entry.
Initial Tableau/Table 1:
Basic Pj Quantity x y S1 S2 Minimum
Variable Ratio
(BV)
S1 0 6 1 1 1 0
S2 0 8 2 1 0 1
Zj 0 0 0 0 0
Pj 5 4 0 0
Pj - Z j 5 4 0 0
Step 4. Determine the entering variable of the optimum column(O.C.), i.e., the
column with the highest positive entry of Pj – Zj row. Encircle the optimum column.
optimum column
IT 305: QUANTITATIVE METHODS 63
UNIT 2: Linear Programming
Step 5. Determine the outgoing or departing variable of the pivot row. The
variable corresponding to the smaller positive ratio is the entering or replaced
variable; thus, S2 is the outgoing variable.
replaced variable
S2 0 8 2 1 0 1 8÷2 = 4
Zj 0 0 0 0 0
Pj 5 4 0 0
Pj - Z j 5 4 0 0
Step 6. Determine the New Pivotal Row (NPR) by dividing each pivotal row
with the pivot element. This pivot element is the entry along intersections of
pivot row and optimum column. Encircle the New Pivot Row.
3
Pj 5 4 0 0
2
Pj - Z j 0
Qty x y S1 S2
NPR (x)
= P.R. ÷ P.E. 8÷2 2÷2 1÷2 0÷2 1÷2
Answer: (x) 4 1 0
Step 7. Determine the new remaining rows and form the second tableau.
New Zj row:
Qty x y S1 S2
Pj - Z j 5 - 5 0- 0
3
4 - -
2
Answer: 0 0 0
Pj - Zj Row
Second Tableau:
Step 8: Construct the next tableau by entering the values obtained from Steps 6
and 7.
Qty x y S1 S2
NPR (y)
= P.R. ÷ P.E. 2÷½ 0÷½ ½÷½ 1÷½
- ÷
Answer: (y) 4 0 1 2 -1
New x Row:
New Zj row:
Qty x y S1 S2
Pj - Z j 5 - 5 4 - 4 0- 3 0-1
Answer: 0 0 -3 -1
(Pj - Zj) Row
x 5 2 1 0 -1 1
Zj 26 5 4 3 1
Pj 5 4 0 0
Pj - Z j 0 0 -3 -1
Since there is no positive entry found on the (Pj – Zj) row, the process stops for
the final or optimum table. Therefore, for every x = 2 and y = 4, Z = 26.
Example 2 :
Subject to x + 2y ≥ 40
10x + 30y ≥ 450
x≥0
y≥0
y≥0
Solution:
Adding the slack variables S1 and S2 and the artificial variables A1 and A2, the
linear programming problem can be stated as follows as the new program of
constraints:
MA2 Subject to x + 2y – S1 + A1 =
40
10x + 30y – S2 + A2 = 450
x, y, S1, S2, A1, A2 ≥ 0
Steps 2 and 3: The initial simplex tableau. Determine the entries for Zj row and
(Cj – Zj) row for a minimization problem and every variable column entry.
Instead of using M1, use powers of 10 like 10, 100, 1000, etc, depending on
the highest coefficient of x and y. In this example, since the highest coefficient is 30,
then we can use 100.
Step 4. Determine the entering variable of the optimum column, i.e., the column
with the highest negative entry in the (Cj – Zj) row. Encircle the optimum column.
Step 5. Determine the outgoing or departing variable of the pivot row. The
variable y corresponding to the smaller positive ratio is the entering or replaced
variable; thus, A2 is the outgoing variable.
Cj 25 30 0 0 100 100
Cj - Zj -1075 -3170 100 100 0 0
replaced variable
outgoing variable pivot element
pivot row
The variable allocated to enter at the next step is y because it has the most
negative value in (Cj – Zj) row and the variable to be replaced is A2 since
A1: 40÷2 =20 and A2: 450 ÷ 30 = 15
Step 6 and 7. Determine the New Pivotal Row (NPR) by dividing each
pivotal row with the pivot element. This pivot element is the entry along
intersections of pivot row and optimum column. Encircle the New Pivot Row.
Second Tableau:
Cj 25 30 0 0 100 100
Cj - Zj 0 100 0
The variable to enter at the next step is X and the variable to be replaced is A1,
since
A 1: = 30
Y: = 45
Third Tableau:
Zj 900 25 30 -45 2 45 -2
Cj 25 30 0 0 100 100
Cj - Zj 0 0 45 -2 55 102
Since there is still a negative entry in the (Cj – Zj) row, then it is not yet optimal.
The variable to enter is S2, and the variable to be replaced is x.
Step 8: Construct the next tableau by entering the values obtained from Steps 6 and
7.
y 30 20 1 0 0
Zj 15 30 -15 0 15 0
600
Cj 25 30 0 0 100 100
Cj - Zj 10 0 15 0 85 100
The absence of negative entries in (Cj – Zj) row indicates that the optimal solution has
been obtained.
Qty x y S1 S2 A1 A2
NPR (y)
= P.R. ÷ 450÷30 10 ÷ 30 30 ÷ 30 0 ÷ 30 -1 ÷ 30 0 ÷ 30 1 ÷ 30
P.E.
Answer: 15 1 0 0
(y)
New Zj row:
Qty x y S1 S2 A1 A2
Cj - Zj 30 - 30 0 – (-100) 100 - 100 –
25 - 0- 100
( )
Answer: 0 100 0
(Cj - Zj) row
Qty x y S1 S2 A1 A2
NPR (x)
= P.R. ÷
P.E. 10÷ ÷ 0÷ -1 ÷ ÷ 1÷ - ÷
Answer: 30 1 0 -3 3
(x) -
+ (- ) (NPRtable 2) +(- )30 +(- )1 +(- )0 +(- )(- +(- )( ) +(- +(- )
3) )(3)
(- )
Answer: (y) Row 5 0 1 1 -1
New Zj row:
Qty x y S1 S2 A1 A2
Cj - Zj 25 - 25 30 – 30 0 – (-45) 0–2 100 - 45 100 – (-2)
Answer: 0 0 45 -2 55 102
(Cj - Zj) row
Qty x y S1 S2 A1 A2
NPR (x)
= P.R. ÷
P.E. 30÷ 1÷ 0÷ -3 ÷ ÷ 3÷ - ÷
Answer: 150 5 0 -15 1 15 -1
(x)
New Zj row:
Qty x y S1 S2 A1 A2
Cj - Zj 25 - 15 30 – 30 0 – (-15) 0 –0 100 - 15 100 – 0
Answer: 10 0 15 0 85 100
(Cj - Zj) row
Name: Date:
Course & Section: Result:
Name: Date:
Course & Section: Result:
Name: Date:
Course & Section: Result:
Name: Date:
Course & Section: Result:
2. Minimize C = - X - 2Y
Subject to
-X + 3Y
10 X + Y
6
X- Y 2
X, Y 0
Name: Date:
Course & Section: Result:
LEARNED?
Name: Date:
Course & Section: Result:
Find out how much you know about this module. Choose the letter that
corresponds to your answer.
1. Linear Programming is a
a. Constrained optimization c. Technique for economic
technique allocation of limited resources
b. Mathematical technique c. All of the above
d.
2. A constraint in linear programming model restricts
a. Value of a decision variable c. Use of the available resources
b. Value of an objective function e. All of the above
f.
3. Constraints of a linear programming model represent
a. limitations c. Balancing limitations and
requirements
b. requirements d. All of the above
6. What is another term for key element common to the incoming and outgoing
vector in simplex method?
a. slack c. pivotal
b. surplus d. Artificial
9. If the given problem is maximization, Zmax then locate the solution point
at the...........point of the feasible zone from the origin
a. P = 20 c. P = 22
b. P = 21 d. P = 23
FOR
ASSESSM
Rubric (Problem Solving Activity)