Linear Programming Models
Linear Programming Models
PROGRAMMING
FACILITATOR-JASSON J. NKONGO 1
Introduction
All organizations, whether large or small, need
optimal utilization of their scarce or limited
resources to achieve certain objectives. Scarce
resources may be money, manpower, materials,
time, etc. In order to achieve best possible
result(s) with the available resources, the decision-
maker must understand all facts about the
organization activities and the relationships
governing among chosen activities and its
outcome.
FACILITATOR-JASSON J. NKONGO 2
The desired outcome may be measured in terms
of profits, time, return on investment, costs.
FACILITATOR-JASSON J. NKONGO 5
(iii) Divisibility:
The decision variables are continuous and
thus can take on fractional values.
(iv) Certainty:
Each parameter is known with certainty. This
implies that all the objective and constraint
coefficients are deterministic, that is all the
data about cost, availability and requirements
is constant.
FACILITATOR-JASSON J. NKONGO 6
Formulation of Linear Programming Models
There are mainly four steps in the mathematical
formulation of linear programming problem as a
mathematical model.
FACILITATOR-JASSON J. NKONGO 7
(ii) Identify the objective function
Objective function is the id the function that its
objective is to maximize profits or minimize
cost. It is expressed in the form of a linear
equation. The equation indicates the
relationship between the output and the
profit. An objective function is expressed as a
combination of variables. The variables are
the number of units of products to be
produced.
FACILITATOR-JASSON J. NKONGO 8
Each variable is multiplied by either the profit per
unit or the cost per unit, depending on whether the
objective is to maximize profits or minimize costs.
FACILITATOR-JASSON J. NKONGO 10
Later possible limiting factors that restrict
production are converted into mathematical
equations similar to the objective function.
The common terms/words use for inequalities are:
• Greater than or equal to, more than or equal to
and at least (≥)
• Less than or equal to, at most (≤)
Note: The use of these symbols also, depends on
the nature of the question.
FACILITATOR-JASSON J. NKONGO 11
Example of constraints are as follows
• 4𝑥 + 7𝑦 ≤ 25
• 2𝑥 + 8𝑦 + 3𝑧 ≥ 12
• 𝑥1 + 3𝑥2 + 4𝑥3 + 𝑥4 ≥ 12
FACILITATOR-JASSON J. NKONGO 12
Example 1
Green Tree Plc manufactures two types of
manure, chemical and bio-chemic. Production is at
full capacity and labour hours are limited to 2,500
for the year. The manure needs to be packed in a
special packaging, which is produced by another
company. This year they can supply Green Tree
Plc with only 5,000 packets. The profit per packet
of the chemical manure is Tshs 5,000 and that of
the bio-chemic manure is Tshs 4,000.
FACILITATOR-JASSON J. NKONGO 13
The labour hours required per packet are 2 hours
for the chemical manure and 3 hours for the bio-
chemic manure. Formulate linear programming
problem model.
Solution
Let variable x be the number of packets of
chemical manure to be produced, and
variable y be the number of packets of bio-
chemic manure to be produced.
FACILITATOR-JASSON J. NKONGO 14
Objective function
Maximize 5000𝑥 + 4000𝑦
FACILITATOR-JASSON J. NKONGO 15
The next constraint is the amount of packaging
material available. Since the product is incomplete
without the proper packaging we can produce only
an amount for which there is proper packaging
available. That is 𝑥 + 𝑦 ≤ 5,000
Packets 𝑥 𝑦 5,000
FACILITATOR-JASSON J. NKONGO 18
Example 2
Arusha Cattle Feed Ltd manufactures two varieties
of cattle feed – fodder plus and fodder premium.
The details of the processing time in the mixing
and blending departments are given below, as is
the profit per kilogram. Formulate a linear
programming problem to arrive at the optimal
product mix.
FACILITATOR-JASSON J. NKONGO 19
Fodder Fodder Total time
plus premium available
𝑥 𝑦
Mixing 4 6 30
department
Blending 5 1.5 24
department
Profit per unit 4 2
(T shs’000)
FACILITATOR-JASSON J. NKONGO 20
Solution
Mixing department constraint
5 hours are required to produce a unit of fodder
plus, therefore the hours required to produce x units
will be the number of units x hours required = 5𝑥
6 hours are required to produce a unit of fodder
premium, therefore the hours required to produce y
units will be number of units × hours required =
6𝑦
Therefore, the total hours available are 30, then, the
constraint will be 5𝑥 + 6𝑦 ≤ 30 hours
FACILITATOR-JASSON J. NKONGO 21
Blending department constraint
4 hours are required to produce a unit of fodder
plus, therefore the hours required to produce x
units will be 4𝑥
Maximize 𝑍 = 4𝑥 + 2𝑦
Subject to 5𝑥 + 6𝑦 ≤ 30
4𝑥 + 1.5𝑦 ≤ 24
𝑥 ≥ 0, 𝑦 ≥ 0
FACILITATOR-JASSON J. NKONGO 23
Example 3
A special diet for laboratory animal is to contain at
most 11 units of vitamins and 56 units of minerals.
There are two mixtures of diet available, mixture A
and mixture B. One gram of mixture A contains 1
unit of vitamins and 4 units of minerals. One gram
of mixture B contains 1 unit of vitamins and 7 units
minerals. Mixture A costs Tshs. 40 per gram, while
mixture B costs Tshs 60 per gram. If the amount of
each mixture was to be used to satisfy the
requirements of the diet at a minimum cost.
FACILITATOR-JASSON J. NKONGO 24
Write down the formulation of that linear
programming problem.
Solution
Let x be the amount of mixture A in grams.
y be the amount of mixture B in grams.
Mixture A Mixture B Amount
(𝑥) (𝑦) available
Vitamins 1𝑥 1𝑦 11
Minerals 4𝑥 7𝑦 56
Costs 40𝑥 60𝑦
FACILITATOR-JASSON J. NKONGO 25
Hence, the linear programming problem can be
written as
FACILITATOR-JASSON J. NKONGO 26
Example 4
Mollel produces two types of biscuits, honey
biscuits and milk biscuits at two plants, Njiro plant
and Ngurudoto plant. The Njiro plant produces
3000 packets of honey biscuits and 2000 packets
of milk biscuits each day at a cost of Tshs 1000.
The Ngurudoto plant produces 1000 packets of
honey biscuits and 6000 packets of milk biscuits
each day at a cost of Tshs 1500. He received an
order for the at least 30,000 packets of honey
biscuits and 60,000 packets of milk biscuits.
FACILITATOR-JASSON J. NKONGO 27
Formulate a linear programming problem model
that representing the production schedule at a
minimum cost.
Solution
Let x be the number of days of production at Njiro
plant.
Y be the amount of days of production at
Ngurudoto plant.
FACILITATOR-JASSON J. NKONGO 28
Njiro plant Ngurodoto Order
(𝑥) plant (𝑦) available
Honey 3,000𝑥 1,000𝑦 30000
Biscuit
Milk 2,000𝑥 6,000𝑦 60000
Biscuit
Costs 1,000𝑥 1,500𝑦
FACILITATOR-JASSON J. NKONGO 29
Hence the linear programming problem can be
written as
FACILITATOR-JASSON J. NKONGO 30
Simplex Method
• In mathematical optimization theory, the simplex
method was created by the American George
dantzig in 1947.
FACILITATOR-JASSON J. NKONGO 31
• Typical uses of the simplex algorithm is to find the
most effective method to perform a task at the
lowest cost (the goal). Many manufacturing
industries rely on simplex method such as for
Transportation systems.
FACILITATOR-JASSON J. NKONGO 33
Slack Variable
• The dummy variable added to inequality ≤ to
transform it into equality.
FACILITATOR-JASSON J. NKONGO 34
For example
Constrain inequality in a given situation like
4𝑥1 + 3𝑥2 ≤ 30
4𝑥1 + 3𝑥2 + 𝑥3 = 30
FACILITATOR-JASSON J. NKONGO 35
Constrain inequality in a given situation like
3𝑥1 + 2𝑥2 ≥ 25
FACILITATOR-JASSON J. NKONGO 36
Set up the initial simplex tableau by creating an
augmented matrix from the equations, placing the
equation for the objective function last (in the
bottom row). Determine a pivot element and use
matrix row operations to convert the column
containing the pivot element into a unit column.
FACILITATOR-JASSON J. NKONGO 37
Pivot Element
The entering variable corresponds to the smallest
(the most negative) entry in the bottom row of the
tableau. The departing variable corresponds to the
smallest nonnegative ratio, in the column
determined by the entering variable. The entry in
the simplex tableau in the entering variable’s
column and the departing variable’s row is called
the pivot.
FACILITATOR-JASSON J. NKONGO 38
To form the improved solution, we apply Gauss-
Jordan elimination to the column that contains the
pivot, This process is called pivoting.
Optimality test:
By investigating the last row of the last tableau, if
we find that there are some negative numbers.
Therefore, the current solution is not optimal.
FACILITATOR-JASSON J. NKONGO 39
Example
The J.J Company has determined that the profits
are Tsh. 6, Tsh. 5, and Tsh. 4 for each type A, type
B, and type C cement that it plans to produce. To
manufacture a type A cement requires 2 minutes
on machine I, 1 minute on machine II, and 2
minutes on machine III. A type B cement requires 1
minute on Machine I, 3 minutes on machine II, and
1 minute on machine III. A type-C cement requires
1 minutes on machine I and 2 minutes on each of
machines II and III.
FACILITATOR-JASSON J. NKONGO 40
There are 3 hours available on machine I, 5 hours
available on machine II, and 4 hours available on
machine III for manufacturing these cements each
day. How many cements of each type should J.J
make per day in order to maximize its profit?
FACILITATOR-JASSON J. NKONGO 41
Solution
The objective function is
𝑍 = 6𝑥1 + 5𝑥2 + 4𝑥3
which is to be maximized.
The constraints are
2𝑥1 + 𝑥2 + 𝑥3 ≤ 180
𝑥1 + 3𝑥2 + 2𝑥3 ≤ 300
2𝑥1 + 𝑥2 + 2𝑥3 ≤ 240
𝑥1 , 𝑥2 , 𝑥3 ≥ 0,
FACILITATOR-JASSON J. NKONGO 42
Insert slack variables to change inequalities into
equations as well as rewrite objective function
2𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 + 0𝑥5 + 0𝑥6 + 0𝑍 = 180
𝑥1 + 3𝑥2 + 2𝑥3 + 0𝑥4 + 𝑥5 + 0𝑥6 + 0𝑍 = 300
2𝑥1 + 𝑥2 + 2𝑥3 + 0𝑥4 + 0𝑥5 + 𝑥6 + 0𝑍 = 24
– 6𝑥1 – 5𝑥2 – 4𝑥3 + 0𝑥4 + 0𝑥5 + 0𝑥6 + 𝑍 = 0
FACILITATOR-JASSON J. NKONGO 43
𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑍 Constant
𝑥4 2 1 1 1 0 0 0 180
𝑥5 1 3 2 0 1 0 0 300
𝑥6 2 1 2 0 0 1 0 240
𝒛𝒋 − 𝒄𝒋 −6 −5 −4 0 0 0 1 0
FACILITATOR-JASSON J. NKONGO 44
The basic feasible solution from the initial tableau is
𝑥1 = 0, 𝑥2 = 0, 𝑥3 = 0, 𝑥4 = 180, 𝑥5 = 300, 𝑥6 = 240 and
𝑃=0
FACILITATOR-JASSON J. NKONGO 45
Select the pivot element
Select the column with the most negative indicator,
that is column 1 in this tableau. Divide each
constant to the right of the bar by the
corresponding (nonzero) element in the pivot
column.
180
= 90
2
300
= 300
1
240
= 120
2
Select the smallest quotient that is 90
FACILITATOR-JASSON J. NKONGO 46
The pivot element is the intersection of the column
with the most negative indicator and the row with
the smallest quotient.
FACILITATOR-JASSON J. NKONGO 47
We divide all the key row values to key element to
get a new row. To get the new row values of the
remaining rows we use the following formula.
FACILITATOR-JASSON J. NKONGO 48
Initial tableau
𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥3 𝑍 Constant
𝑥4 2 1 1 1 0 0 0 180
𝑥5 1 3 2 0 1 0 0 300
𝑥6 2 1 2 0 0 1 0 240
𝑧𝑗 − 𝑐𝑗
−6 −5 −4 0 0 0 1 0
FACILITATOR-JASSON J. NKONGO 49
First tableau
𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑍 Constant
𝑅1
𝑥1 1 0.5 0.5 0.5 0 0 0 90 𝑅1 =
2
𝑥5 0 2.5 1.5 −0.5 1 0 0 210 𝑅2 = 𝑅2 − 𝑅1
𝑥6 0 0 1 −1 0 1 0 60 𝑅3 = 𝑅3 − 2𝑅1
𝑧𝑗 − 𝑐𝑗
0 −2 −1 3 0 0 1 540 𝑅4 = 𝑅4 + 6𝑅1
FACILITATOR-JASSON J. NKONGO 50
By investigating the last row of the first tableau,
we find that there are some negative numbers.
Therefore, the current solution is not optimal. Now
select the new pivot element.
FACILITATOR-JASSON J. NKONGO 51
second tableau
𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑍 Constant
𝑥1 1 0 0.2 0.6 −0.2 0 0 48 𝑅1 = 𝑅1 − 0.5𝑅2
𝑅2
𝑥2 0 1 0.6 - 0.2 0.4 0 0 84 𝑅2 =
2.5
𝑥6 0 0 1 −1 0 1 0 60 𝑅3 = 𝑅3 − 2𝑅1
𝑧𝑗 − 𝑐𝑗
0 0 0.2 2.6 0.8 0 1 708 𝑅4 = 𝑅4 + 2𝑅2
FACILITATOR-JASSON J. NKONGO 52
By investigating the last row of the second
tableau, we find that there are no negative
numbers. Therefore, the current solution is optimal.
FACILITATOR-JASSON J. NKONGO 53
The interpretation of the solution is that if 48
cement of type A, 84 of type B and none of type C
are made, there will be of Tshs. 708
Answer check
𝑃 = 6𝑥1 + 5𝑥2 + 4𝑥3
𝑃 = 6(48) + 5(84) + 4(0)
𝑃 = Tshs. 708
FACILITATOR-JASSON J. NKONGO 54
Class Activity
Solve the following questions by using simplex method.
1. The Cannon Hill furniture Company produces
tables and chairs. Each table takes four hours of
labor from the carpentry department and two hours
of labor from the finishing department. Each chair
requires three hours of carpentry and one hour of
finishing. During the current week, 240 hours of
carpentry time are available and 100 hours of
finishing time. Each table produced gives a profit of
$70 and each chair a profit of $50. How many
chairs and tables should be made?
FACILITATOR-JASSON J. NKONGO 55
2. Solve the following problem using
FACILITATOR-JASSON J. NKONGO 56
3. Maximize Z = 𝑥1 + 2𝑥2 + 3𝑥3
subject to 𝑥1 + 𝑥2 + 𝑥3 ≤ 12
2𝑥1 + 𝑥2 + 3𝑥3 ≤ 18
𝑥1 , 𝑥2 , 𝑥3 ≥ 0
FACILITATOR-JASSON J. NKONGO 57
5. A farmer has 100 acres of land on which she plans
to grow wheat and corn. Each acre of wheat
requires 4 hours of labor and $20 of capital, and
each acre of corn requires 16 hours of labor and
$40 of capital. The farmer has at most 800 hours
of labor and $2400 of capital available. If the profit
from an acre of wheat is $80 and from an acre of
corn is $100, how many acres of each crop should
she plant to maximize her profit?
FACILITATOR-JASSON J. NKONGO 58
6. A factory manufactures chairs, tables and
bookcases each requiring the use of three
operations: Cutting, Assembly, and Finishing. The first
operation can be used at most 600 hours; the second at
most 500 hours; and the third at most 300 hours. A chair
requires 1 hour of cutting, 1 hour of assembly, and 1
hour of finishing; a table needs 1 hour of cutting, 2 hours
of assembly, and 1 hour of finishing; and a bookcase
requires 3 hours of cutting, 1 hour of assembly, and 1
hour of finishing. If the profit is $20 per unit for a chair,
$30 for a table, and $25 for a bookcase, how many
units of each should be manufactured to maximize
profit?
FACILITATOR-JASSON J. NKONGO 59
7. The Acme Apple company sells its Pippin,
Macintosh, and Fuji apples in mixes. Box I
contains 4 apples of each kind; Box II contains
6 Pippin, 3 Macintosh, and 3 Fuji; and Box III
contains no Pippin, 8 Macintosh and 4 Fuji
apples. At the end of the season, the company
has altogether 2800 Pippin, 2200 Macintosh,
and 2300 Fuji apples left. Determine the
maximum number of boxes that the company
can make.
FACILITATOR-JASSON J. NKONGO 60
8. A small petroleum company owns two refineries.
Refinery 1 costs Tsh 20,000 per day to operate, and it
can produce 400 barrels of high-grade oil, 300 barrels of
medium-grade oil, and 200 barrels of low-grade oil each
day. Refinery 2 is newer and more modern. It costs Tsh
25,000 per day to operate, and it can produce 300
barrels of high-grade oil, 400 barrels of medium-grade oil,
and 500 barrels of low-grade oil each day. The company
has orders totaling 25,000 barrels of high-grade oil,
27,000 barrels of medium-grade oil, and 30,000 barrels
of low-grade oil. How many days should it run each
refinery to minimize its costs and still refine enough oil to
meet its orders?
FACILITATOR-JASSON J. NKONGO 61
FACILITATOR-JASSON J. NKONGO 62
FACILITATOR-JASSON J. NKONGO 63