0% found this document useful (0 votes)
0 views

Week 7 - Linear Programming New

Linear programming involves optimizing an objective function subject to constraints expressed as linear equations or inequalities. The simplex method is a key technique for solving linear programming problems, allowing for the handling of multiple variables and constraints. The document outlines various methods for solving linear equations, including substitution and elimination, and provides examples of maximization and minimization problems.

Uploaded by

miyarishin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Week 7 - Linear Programming New

Linear programming involves optimizing an objective function subject to constraints expressed as linear equations or inequalities. The simplex method is a key technique for solving linear programming problems, allowing for the handling of multiple variables and constraints. The document outlines various methods for solving linear equations, including substitution and elimination, and provides examples of maximization and minimization problems.

Uploaded by

miyarishin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Linear

programming
“Linear” = direct proportionality of
relationship of variables.
“Programming” = making schedules or plans
of activities to undertake in the future.
Linear Programming = planning by the use
of linear relationship of variables involved.
Linear Programming model is designed to maximize
(minimize) an objective function of the form:

where f is the same economic objective such as profit,


production, cost, workweeks, or tons shipped.

LP is composed of 2 main parts:


 Objective Function (Max or Min)
 Constraints – mathematical relationships expressed
in terms of linear equations or linear inequalities in
the form:

 “a coefficients” are constraints


General Form of LP Model:
Max (Min):
Subject to:
explicit
constraints

𝑥1 , 𝑥 2 , … , 𝑥𝑛 ≥ 0 implicit
constraints
System of Linear Equations
 A system of equations is a collection of two or more
equations with a same set of unknowns.
 In solving a system of equations, we try to find values
for each of the unknowns that will satisfy every
equation in the system.
 The equations in the system can be linear or non-
linear.
 A system of linear equations can be solved four
different ways:
• Substitution
• Gaussian Elimination
• Matrices
• Graphing
System of Equations in Two Variables

 A system of equations is a collection of two or more


equations with the same set of unknowns.
 In solving a system of equations, we try to find values for
each of the unknowns that will satisfy every equation in the
system.
 A problem can be expressed in narrative form or the
problem can be expressed in algebraic form.
Example:

A total of ₱12,000 is invested in two


funds paying 9% and 11% simple
interest. If the yearly interest is ₱1,180,
how much of the ₱12,000 is invested
at each rate?
x + y = P12,000
0.9x + 0.11y = P1,180
The Method of Substitution:

x + y = P12,000 - eq. 1
0.09x + 0.11y = P1,180 - eq. 2

x = 12,000 – y – eq. 3

Substitute eq. 3 in eq. 2 :


0.9x + 0.11y = P1,180
Substitute eq. 3 to eq. 2 :
0.9x + 0.11y = P1,180
0.09 (12,000 – y ) + 0.11y = 1,180
1,080 – 0.09y + 0.11y = 1,180
0.02 y = 1,180 – 1080
0.02 y = 100
0.02 0.02
y = 5,000 - eq. 4
Substitute eq. 4 in eq. 3 :
x = 12,000 – y
x = 12,000 – 5,000
x = P7,000
Checking @ x = 7,000 ; y = 5,000
x + y = P12,000 - eq. 1
0.09x + 0.11y = P1,180 - eq. 2

: x + y = P12,000 - eq. 1
7,000 + 5,000 = P 12,000
P12,000 = P12,000

: 0.09x + 0.11y = P1,180 - eq. 2


0.09(7,000) + 0.11(5,000) = P1,180
630 + 550 = P1,180
P1,180 = P1,180
Ex.
Substitute eq. 4 in eq. 3:
2a + 4b = 50 - eq. 1
a = 25 – 2b
3a + 5b = 66 - eq. 2
= 25 – 2 (9)
Transpose 4b:
= 25 – 18
New Equation::
a=7
2a = 50 – 4b
2 2
a = 25 – 2b - eq. 3
 : 2a + 4b = 50 eq. 1
Substitute eq. 3 in eq. 2: 2(7) + 4(9) = 50
3a + 5b = 66 14 + 36 = 50
3 ( 25 – 2b ) + 5b = 66 50 = 50
75 – 6b + 5b = 66
-b = 66 – 75  : 3a + 5b = 66 eq. 2
-b=-9 3 (7) + 5(9) = 66
-1 -1 21 + 45 = 66
b = 9 - eq. 4 66 = 66
The Method of Elimination:

x + y = P12,000 - eq. 1 //* -0.09


0.09x + 0.11y = P1,180 - eq. 2

New Equation:
- 0.09x - .09 y = -1080
0.09 x + 0.11y = 1,180
0.02y = 100
0.02 0.02
y = 5,000 - eq. 3

Substitute eq. 3 in eq. 1:


x + y = P12,000
x = 12, 000 – y
x = 12,000 – 5,000 = 7,000
The Method of Elimination:

2a + 4b = 50 - eq. 1//*-3
3a + 5b = 66 - eq. 2//*2

New Equation: Substitute eq. 3 in 1


-6a – 12b = - 150 2a + 4b = 50
6a + 10b = 132 2a + 4(9) = 50 ;
- 2b = - 18
-2 -2 2a + 36 = 50 ;
b = 9 eq. 3 2a = 50 - 36
2a = 14
2 2
a=7
Linear Programming: Graphing Method
Steps to be followed in LP Graphical Method:
1) Formulate the linear program.
2) Graph the inequalities and shade the feasible region.
3) Solve for the coordinates of the vertices of the feasible
region.
4) Substitute the coordinates of the vertices of the feasible
region to the objective function.
5) Formulate your decision. If it is a maximization, choose
the vertex that give you the highest value. Whereas, if it
is minimization, choose the vertex that will give you the
lowest value.
Maximization Problem
Example 1.
The Morgan Furniture makes two products: tables and
chairs, which must be processed through assembly and
finishing departments. Assembly department is
available for 60 hours in every production period, while
the finishing department is available for 48 hours of
work. Manufacturing one table requires 4 hours in the
assembly and 2 hours in the finishing. Each chair
requires 2 hours in the assembly and 4 hours in the
finishing. One table contributes P180 to profit, while a
chair contributes P100. The problem is to determine the
number of tables and chairs to make per production
period in order to maximize the profit. .
Minimization Problem
Example 2.
A small generator burns two types of fuel: low sulfur and
high sulfur to produce electricity. For one hour, each
gallon of low sulfur emits 3 units of sulfur dioxide,
generates 4 kilowatts electricity and costs P160. Each
gallon of high sulfur emits 5 units of sulfur dioxide,
generates 4 kilowatts and costs P150. The
environmental protection agency insists that the
maximum amount of sulfur dioxide that can be emitted
per hour is 15 units. Suppose that at least 16 kilowatts
must be generated per hour, how many gallons of high
sulfur must be utilized per hour in order to minimize the
cost of fuel? .
Maximization Problem
Example 3.
To make one unit of product A requires three (3) minutes in
Dept. I and one (1) minute in Dept. II. One unit of
product B requires four (4) minutes in Dept. I and two
(2) minutes in Dept. II. Profit contribution is P5/unit of A
and P8/unit of B. Find the number of units of A and B,
which should be made to maximize profit if Dept. I and II
have 150 and 60 minutes available respectively. What is
the maximum and minimum profit?
Minimization Problem
Example 4.
A veterinarian mixes two types of animal feeds. Type X and
Type Y. Each unit of Type X feed costs P200 and
contains 40 grams of fat, 20 grams of protein, and 1,600
calories. Each unit of Type Y feeds costs P180 and
contains 60 grams of fat, 60 grams of protein, and 1,200
calories. Suppose the veterinarian wants each unit of
the final product to yield at most 360 grams of fat, at
least 240 grams of protein, and at most 9,600 calories.
How many of each type of feeds should the veterinarian
use to minimize his cost?
Linear
programming
By SIMPLEX METHOD
Linear Programming (Simplex Method)

The simplex method of linear programming was


developed by George B. Dantzig of Stanford University. It
is a repetitive optimizing technique.
It repeats the process of mathematically moving
from an extreme point to another extreme point until an
optimal solution is reached.

It can handle an infinite number of variables.


Simplex Maximization Problem

Steps in solving a Maximization problem:


1) Set up the constraints from the conditions of the
Problem.
2) Convert the inequality explicit constraints to equations
by adding slack variables.
3) Enter the numerical coefficients and variables in the
simplex method.
4) Calculate Cj and Zj values.
5) Determine the optimum column or entering variable by
choosing the most positive value in the Cj – Zj row.
6) Divide the quantity column values by the non zero and
non negative entries in the optimum column. The
smallest quotient belongs to the pivotal row.
7. Compute the values for the replacing row by dividing all
entries by the pivot. Enter the result in the next table.

8. Compute the next entries for the remaining rows by reducing


the optimum column entries to zero.

9. Calculate Cj and Zj values

10. If there is positive entry in the Cj – Zj row, return to step 5.


The final solution has been obtained if there is no positive
values in the Cj – Zj row.
Linear Programming (Simplex Method)

Iteration is a simplex method which consists of the


sequence of steps (row operations) performed in moving one
basic feasible solution to another.
Simplex Tableau is a table use to keep track of the
calculations made when the simplex method is employed.
Right-Hand-Side (RHS) is the column in a simplex
tableau indicating the quantities of the variables is in a solution.
Basic Variables (BV) are the variable included in a
basic solution.
Slack Variables (Sn) are variables added to constraints
to convert them into equations.
Linear Programming (Simplex Method)

Pivot Column is the column in any solution to a


maximization problem which has the lowest negative value in
the last row.
Pivot Row is the row in the simplex tableau
corresponding to the basic variable that will leave the
solution.
- determined by the TEST RATIO and it is computed
by dividing the RHS by the intersectional elements. It should
be POSITIVE. After applying the TR, choose the smallest
positive.
Pivot is the element in the simplex tableau that is in
both the pivot row and pivot column.
Simplex Maximization Problem

Ex. Maximize Z = 80x + 60y


Subject to :
4x + 2y< = 60 Explicit constraints
2x + 4y <=48
x , y >= 0 Implicit constraints
New Eq.

Max P = 80x +60y + 0s1 + 0s2


s.t. : 2x + y + S1 = 30
x + 2y + S2 = 24
x , y, S1, S2 >= 0
Initial Tableu:

Cj 80 60 0 0
Prod Qty X Y S1 S2
0 S1 30 2 1 1 0
0 S2 24 1 2 0 1
Zj 0 0 0 0 0
Cj – Zj 80 60 0 0
Table 1: Determine the pivotal row ( the lowest value of Qty )
and column ( optimum column )

Cj 80 60 0 0
Prod Qty X Y S1 S2
0 S1 30 2 1 1 0
0 S2 24 1 2 0 1
Zj 0 0 0 0 0
Cj – Zj 80 60 0 0
Table 1:
Cj 80 60 0 0
Prod Qty X Y S1 S2
0 S1 30 2 1 1 0
0 S2 24 1 2 0 1
Zj 0 0 0 0 0
Cj – Zj 80 60 0 0

Table 2:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
0 S2 24 1 2 0 1
Zj 0 0 0 0 0
Cj – Zj 80 60 0 0
Table 2:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
0 S2 24 1 2 0 1

Zj 0 0 0 0 0
Cj – Zj 80 60 0 0

Computing S2:
15(-1) = -15+24 = 9
1(-1) = -1 + 1 = 0
½(-1) = -1/2 +2 = 1 ½ or 3/2
½ ( -1) = - ½ + 0 = - ½
0–1=1
Computing S2:
15(-1) = -15+24 = 9
1(-1) = -1 + 1 = 0
½(-1) = -1/2 +2 = 1 ½ or 3/2
½ ( -1) = - ½ + 0 = - ½
0–1=1

Table 3:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
0 S2 9 0 3/2 -1/2 1
Zj 1200 80 40 40 0

Cj – Zj 0 20 - 40 0
Table 3: Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
0 S2 9 0 3/2 -1/2 1 Divide 3/2
Zj 1200 80 40 40 0

Cj – Zj 0 20 - 40 0

Table 4:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
60 Y 6 0 1 -1/3 2/3
Zj 1200 80 40 40 0

Cj – Zj 0 20 - 40 0
Table 4:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 15 1 1/2 1/2 0
60 Y 6 0 1 -1/3 2/3
Zj 1200 80 40 40 0

Cj – Zj 0 20 - 40 0

Solving for the new entries in the x row:

6(- ½) + 15 = -3 +15 = 12
0 (- ½) + 1 = 0 +1 =1
1 (- ½) + ½ = - ½ + ½ = 0
- 1/3 (- ½) + ½ = 1/6 + ½ = 4/6 = 2/3
2/3 (- ½) + 0 = 1/3 + 0 = 1/3 = 0 - 1/3 = - 1/3
Solving for the new entries in the x row:

6(- ½) + 15 = -3 +15 = 12
0 (- ½) + 1 = 0 +1 =1
1 (- ½) + ½ = - ½ + ½ = 0
- 1/3 (- ½) + ½ = 1/6 + ½ = 4/6 = 2/3
2/3 (- ½) + 0 = 1/3 + 0 = 1/3 = 0 - 1/3 = - 1/3

Last Table:
Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 12 1 0 2/3 - 1/3
60 Y 6 0 1 -1/3 2/3
Zj 960 80 0 160/3 -80/3
360 0 60 -60/3 120/3
1,320 80 60 100/3 40/3
Cj – Zj 0 0 -100/3 -40/3
Last Table:

Cj 80 60 0 0
Prod Qty X Y S1 S2
80 X 12 1 0 2/3 - 1/3
60 Y 6 0 1 -1/3 2/3
Zj 960 80 0 160/3 -80/3
360 0 60 -60/3 120/3
1,320 80 60 100/3 40/3
Cj – Zj 0 0 -100/3 -40/3

Therefore: x = 12 and y = 6 to max z = P1,320


Since x = 12 , y = 6 and max z = P1,320

Max z = 80x +60y + 0s1 + 0s2


s.t. : 2x + y + S1 = 30
x + 2y + S2 = 24
Checking:
Max P : 80 (12 ) + 60 ( 6 ) = P1,320
960 + 320 = P1,320
P1,320 = P1,320

Subject to : 2x + y + S1 = 30 x + 2y + S2 = 24
2(12) + 6 + 0 = 30 12 + 2 (6) + 0 = 24
24 + 6 + 0 = 30 12 + 12 + 0 =24
30 = 30 24 = 24
Simplex Maximization Problem
Example.
Maximize: Z = 80X + 60Y
Subject to: 4X + 2Y ≤ 60
2X + 4Y ≤ 48
X≥0
Y≥0
.
Simplex Maximization Problem
Steps in solving a Maximization problem:
1) Set up the constraints from the conditions of the
problem.
2) Convert the inequality explicit constraints to equations
by adding slack variables.
3) Enter the numerical coefficients and variables in the
simplex table.
4) Calculate Cj and Zj values.
5) Determine the optimum column or entering variable by
choosing the most positive value in the Cj – Zj row.
6) Divide the quantity-column values by the non-zero and
non-negative entries in the optimum column. The
smallest quotient belongs to the pivotal row.
Simplex Maximization Problem
Steps in solving a Maximization problem:
7) Compute the values for the replacing row by dividing all
entries by the pivot. Enter the result in the next table.
8) Compute new entries for the remaining rows by reducing
the optimum column entries to zero (entries in the
constraint rows).
9) Calculate Cj and Zj values. Compute also for Cj – Zj row.
10) If there is a positive entry in the Cj – Zj row, return to step
5. The final solution has been obtained if there is no
positive value in the Cj – Zj row.
Simplex Maximization Problem
Example.
Maximize: Z = 80X + 60Y
Subject to: 4X + 2Y ≤ 60
2X + 4Y ≤ 48
X≥0
Y≥0
.
Simplex Maximization Problem
Simplex Tableau 1
Contribution to profit column
Variable column (Entering Variables)

Constant column
OF coeff.
Cj 80 60 0 0 row
Prod Qty x y S1 S2 Variable row

0 S1 30 2 1 1 0 Constraints
coeff. rows
0 S2 24 1 2 0 1

Zj 0 0 0 0 0

Cj – Zj 80 60 0 0
Simplex Maximization Problem
Continuation.
Simplex Maximization Problem Containing “ ≥ ”
 In Maximization problem, we always add a slack variable
to convert a constraint to equation.
 If the constraint has a “≥” symbol, we cannot transform it
to equation by immediately adding a slack variable for
obvious reason.
 Instead, first convert “≥” symbol to “≤” by multiplying the
inequality constraint by negative 1.
 Then add a slack variable.
Simplex Maximization Problem Containing “ ≥ ”
Example.
Maximize: 50X1 + 20X2
Subject to: X1 ≤ 20
X2 ≤ 30
X1 + X2 ≥ 48
X1 ≥ 0
X2 ≥ 0
Simplex Maximization Problem
Example.
A poultry raiser plans to raise chicken, ducks and
turkeys. He has room for only 200 birds and wishes to
limit the number of turkeys to a maximum of 25, the
number of turkeys and ducks to a maximum of 100. His
estimated profits are Php 30, Php 25 and Php 125 on
each chicken, duck and turkey respectively. How many
of each should he raise to maximize his profit?
.
Simplex Maximization Problem Containing “ = ”
 As a rule, add a slack variable to the left member of the
constraint containing the equal symbol.

Example.
Maximize: 5X1 + 4X2
Subject to: 2X1 + X2 = 12
2X1 + 3X2 ≤ 24
2X1 + 9X2 ≥ 36
X1 ≥ 0
X2 ≥ 0
.
Simplex Minimization Problem
Steps in solving a Minimization problem are similar to
maximization except for 3 processes.
1) The Cj column of the initial table begins with the
coefficient of artificial variables and of slack variables in
the objective with positive coefficients in the constraints.
2) Instead of looking for the most positive quantity in Cj – Zj
row for the optimum column, look for the most negative
entry.
3) The optimum table or final table has entries in the Cj – Zj
row which are either zero or positive.
Simplex Minimization Problem
Summary of converting constraints to equations:
1) Add an artificial variable if the symbol is “=“.
2) Add a slack variable if the symbol if “≤”.
3) Subtract a slack variable but add an artificial variable if
the symbol is “≥”.

Note: In representing the contribution of the artificial


variable to the objective, use a quantity which is a
power of ten, greater than any of the coefficients
found in the constraints and objective function.
Powers of ten are numerals such as 10, 1000, 1000,
etc.
Simplex Minimization Problem
Example.
Minimize: 20X1 + 10X2 + 80X3
Subject to: X 1 + X 2 + X2 ≥ 6
2X1 + 4X2 + X3 = 20
2X1 + X2 ≤ 5
X1, X2, X3 ≥
.
Simplex Minimization Problem
Example.

A manufacturer of commercial chemicals has an order for a


certain mixture consisting of two ingredients, x and y
which cost Php4.00 and Php5.00 per kilo, respectively.
The following are the specifications: the weight of the
mixture must be 100 kilos, it cannot be contain more
than 30 kilos of x and it must contain at least 20 kilos of
y. Find the mixture of the two ingredients, which
satisfies the customers’ requirements and still yield a
minimum total cost of raw materials. .
Simplex Minimization Problem
Example.
Four foods X1 , X2 , X3 , and X4 , are to be produced.
X1 contains 2 calories, no vitamin and costs Php 40 per
unit. X2 contains no calorie, 2 units of vitamins and
costs Php 100. X3 contains 1 unit of calorie, 1 unit of
vitamin and costs Php 120 per unit. X4 contains 3 units
of calories, 2 units of vitamins and costs Php 150 per
unit. The minimum calorie requirement is 15 units and
the minimum vitamin requirement is 8 units. How much
of each food should be produced to satisfy theses
requirements and to minimize the total cost?
.
References
 Dugopolski, Mark (2009). Algebra for college
students. McGraw-Hill. USA
 Hillier, Frederick and Gerald Lieberman. Introduction
to operations research. McGraw-Hill. Singapore.
 Larson, Ron (2018). College Algebra. Cengage
Learning. Boston, MA
 Taha, Hamdy (1997). Operations research: An
introduction. Prentice Hall. Singapore.
 Victoriano, Praxedes S. (1990). Quantitative
Techniques for Business Management (2nd Ed.). Rex
Book Store, Manila, Philippines.

You might also like