You are on page 1of 22

Linear Programming

Elmer S. Poliquit
Introduction to Linear Programming
Let x be the travel time in minutes for each ride.
Then the program is
Minimize x subject to
3x ≥ 90 – the condition when riding a
jeepney,
2x ≥ 40 – the condition when riding a
motorbike, and
x ≥ 25 – the condition when riding a taxi.
Linear Inequalities in Two Variables
Warm-ups
Prepare for this section by completing the following
exercises.
1. Evaluate C = 2x + 5y when x = 2, and y = 3.
2. Evaluate P = 3x – 4y + 6z when x = 1, y = -2, and z
= 5.
3. Find a pair of value of x and y that satisfy the
equation 2x + 3y =18.
4. Find values of x, y, and z that satisfy the
equation 3x – 2y + z = 0.
Linear Inequalities in Two Variables
Definition 9.1.1
In general, a linear inequality in two variables is
in the form of
Ax + By > C or Ax + By < C,
where A, B, and C are arbitrary constants. This is
called single linear inequality. □
For example, 3x – 2y > 6.
Linear Inequalities in Two Variables
Example 1. [Buying
Problem] Suppose you only
have ₱55 in your pocket.
You are to buy x number of
mangoes at ₱20 each and y
number of pineapples at
₱25 each. Construct an
inequality and find possible
values of x and y so that
your money will be enough.
Linear Inequalities in Two Variables
Example 2. Is (0, 0, 0) a Example 3. Find two
solution to the inequality ordered pairs that satisfy
4x – 3y + 5z > 24? the inequality -3x + 4y ≤
12.
9.2 Geometry of Linear Programming
Warm-ups
Prepare for this section by completing the
following exercises.
1. Graph 3x + 3y = 12.
2. Graph y = -2x + 3.
3𝑥 − 5𝑦 = 15
3. Graph { 𝑥 + 3𝑦 = 12
9.2 Geometry of Linear Programming
Graphing a Single
Inequality
A single linear inequality
determines a unique half-
plane. The half-plane is a
set of points that satisfy
the inequality.
9.2 Geometry of Linear Programming
Linear Programming: A Geometric Approach
USC School Uniforms
Business managers make decisions with the objective of
how to maximize profit or minimize cost. For example
[Manager Problem], a manager of a tailoring shop
subcontracts uniforms to two different shops for two
different uniform designs, A and B. The first shop requires
1 hour to finish design A and 3 hours for design B. The
second shop requires 2 hours to finish design A and 4
hours for design B. Furthermore, the total number of
hours allocated for the first shop is 90 and the total
available hours for the second shop is 140.
9.2 Geometry of Linear Programming
Theorem. Bounded Feasible Region
When the feasible region is not empty and is
bounded, the objective function has both a
maximum and a minimum value, which must
occur at corner points.
9.3 The Simplex Method
Definition 9.3.1. The standard form of a linear program is
Max/Min z = c1x1 + c2x2 + ⋯ + cnxn
subject to a11x1 + a12x2 + ⋯ + a1nxn = b1
⋮ ⋮ ⋮
am1x1 + am2x2 + ⋯ + amnxn = bm,
where the objective is to maximize or minimize, the constraints are the
equalities and the variables are all nonnegative. □
9.3 The Simplex Method
Definition 9.3.2. An augmented matrix for a system of
equations is a matrix of numbers in which each row
represents the constants from one equation (both the
coefficients and the constant on the other side of the
equal sign) and each column represents all the
coefficients for a single variable. □

Note: Slack variable*is a variable added to the problem


to eliminate less-than constraints.
Surplus variable is a variable added to the problem to
eliminate greater-than constraints.
Gauss-Jordan Method
Three elementary row operations
i. Exchange any two rows.
ii. Multiply any row by a nonzero constant.
iii. Add one row to another row.
[Investment Problem]
Mario has ₱900,000 to invest. He invested his
money in three different accounts that offers
4%, 3%, and 2% simple interest. At the end of
the year, the total interest he made in three
accounts was ₱27,000. If the amount of money
invested in the 2% account was twice the money
invested in the 3% account, how much did
Mario invest in each account?
Gauss-Jordan Method
Pre-processing
I. Write an augmented matrix of the system.
II. Make the first entry (row 1, column 1) of the matrix a 1 by
(a) Rearranging rows and/or
(b) Dividing row 1 by the first entry to make it a 1.
III. Make the rest of the first column entries to zero below the first entry of row 1 by
(a) Taking the negative of the number in the position to be made
zero and multiply to row 1.
(b) Add this multiple of row 1 to the row where the zero is
needed. The result becomes a new row.
IV. Make row 2 and column 2 a 1 by
(a) Rearranging the rows below row 1 and/or
(b) Dividing row 2 by an entry of row 2 and column 2.
V. Make all other entries below row 2 and column 2 a zero by doing step III (a) and
(b).
Gauss-Jordan Method
Pre-processing
V. Make all other entries below row 2 and column 2 a zero
by doing step III (a) and (b).
VI. Make row 3 and column 3, row 4 and column 4, ⋯, row n
and column n entries to 1 by following the same process
in step V. (Do not forget zeroes below each row i and
column i.) If some row produces all zeros except the last
column in the process, the row produces an
VII. The last row now gives the value of the last given
variable. If the last row produces zeroes including the last
column, the system has infinite solution
VIII. Back substitution. Substitute the value obtained in the last
row n to row n-1 until each single variable has a value.
Exercises
1. 2x – 5y = -3
3x + 4y = 7
2. x – y + 3z = -8
2x + z= 0
x + 5y + z = 40
Exercises
3. A boat travels 40 kilometers downstream in 5 hours
and returns upstream in 7 hours. Find the rate of speed
of the current and the speed of the boat in still water if
x represents the speed of the boat in still water and y
represents the speed of the current.
4. Mr. P has a total of ₱600,000 invested in three funds
paying 6%, 8%, and 9% simple interest. The total
annual interest is ₱45,000. The money invested at 6%
is twice as much money invested at 9%. How much
was invested in each of the funds?
Problem
Solve the linear program using simplex method.
Maximize P(x, y) = 60000x + 30000y
subject to
x + y ≤ 10
x+ y≥8
2x + y ≤ 15
x + 2y ≤ 12
x, y ≥ 0.
Summary of the Simplex Method
Consider that the Linear Program is in its standard form.
1. Convert the problem to a system of equations:
(a) Convert min z to max –z.
(b) Convert each inequality to an equation by adding a slack/surplus variable.
(c) Write the objective function
z = a1x1 + a2x2 + ⋯ + anxn as
-a1x1 - a2x2 - ⋯ - anxn + z = 0,
where a1, a2, … , an are constants and x1, x2, …, xn are variables.
2. Form the initial simplex tableau from the linear program.
3. Choose an entering variable by locating the most negative entry in the last row.
4. Divide each entry in the last column (b-column) by the corresponding entry in the entering
variable except the entry in the last row.
5. Choose the row as pivot with the smallest positive ratio. In case of a tie for pivot row, choose
either.
6. Modify the simplex tableau by using row operations to obtain a new solution.
7. If there is a negative entry in the last row of the tableau, z is not maximum. Repeat the process in
steps 3, 4, 5, and 6 until the last row has no negative entry.
8. If the bottom row contains no negative entries, z is maximum and the solution is available from
the final tableau.
9. Determine the solution from the final tableau. These basic variables correspond to unit columns
(i.e. zeros in the other column entries except the last row). Be sure that the basic variables satisfy
in all constraints. State the maximum value and the values of the original variables that give the
maximum value.
Notice that the z-column in the simplex tableau never changes in the pivoting operations. Thus, you
may omit that column.
Exercises
Solve the following linear programming problems.
Assume x ≥ 0, y ≥ 0, and z ≥ 0.
1. Maximize P = 2x + 5y with the constraints
x + y ≤ 15
3x + 4y ≤ 30
x + 2y ≤ 6.
2. Minimize C = 2x +5y –z with constraints
x + 2y + z ≥ 16
7x + y + 2z ≥ 18
x + 3y - z ≥ 10.
Exercises
A. Maximize Profit. Lulu has an online shop where she sells hand painted shirts and
blouses. She sells a shirt for ₱350 and a blouse for ₱550. It takes 45 minutes to
paint a shirt and an hour to paint a blouse, and, since Lulu also tutors, she only has
15 hours a week to hand paint. In addition, she only has enough materials to paint
15 total shirts and blouses per week. She makes a profit of ₱150 on each shirt and
₱250 on each blouse. How many shirts and blouses should Lulu make each week
in order to maximize her profit, assuming she sells all her items?
B. Minimize Cost. Dr. Amaca produces two animal foods, Food C and Food D. Each
food contains three major ingredients: I1, I2, and I3. Each ton of Food C requires
200 kilograms of I1, 100 kilograms of I2, and 100 kilograms of I3. Each ton of
Food D requires 100 kilograms of I1, 200 kilograms of I2, and 400 kilograms of I3.
There are at least 5000 kilograms of I1 available, at least 7000 kilograms of I2
available, and at least 10,000 kilograms of I3. Each ton of Food C cost ₱22,500 to
make, and each ton of Food D costs ₱9000 to make. How many tons of each food
product should Dr. Amaca make to minimize cost? What is the minimum cost?

You might also like