Linear Programming Module
Linear Programming Module
Linear Programming Module
x
y
.
You can draw a search line with 2 and 3 as the y-intercept and x-intercept, respectively.
Optimal solution occurs at the point
|
.
|
\
|
3
10
,
3
4
.
That is, the company should produce
3
1
1 tons of interior paint, and
3
1
3 tons of exterior paint daily.
The maximum daily gross income of the company = RM
|
.
|
\
|
+
3
10
3
3
4
2 1000
= RM12,666.67
6 2 = + y x
8 2 = + y x
1 = y x
y x z 3 2 + =
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
7
Notice that the feasible region of a linear programming problem is a convex polygon, if it is
bounded. Thus the maximum and the minimum values of an objective function occur at the
vertices, or at all the points of a bounded line segment of the feasible region.
Hence, an alternative way of finding an optimal solution is to evaluate the objective function at
each of the vertices of the feasible region, and then choose a vertex at which the value of the
function is optimal.
Example 5: (Minimization problem)
Minimize the objective function
y x z 5 + =
subject to the constraints
12 4 s + y x
8 s x
2 > + y x
0 > x
0 > y
The optimal solution is:
x = 2, y = 0 and z = 2.
Alternatively, evaluate the objective function at each corner point:
Corner point, (x, y) Value of y x z 5 + =
(0, 3) 15 ) 3 ( 5 0 = + = z
(8, 1) 13 ) 1 ( 5 8 = + = z
(8, 0) 8 ) 0 ( 5 8 = + = z
(2, 0) 2 ) 0 ( 5 2 = + = z
(0, 2) 10 ) 2 ( 5 0 = + = z
The minimum value of z is 2 when x = 2 and y = 0.
Optimal solution
occurs at this point
12
10
8
6
4
2
-2
-5 5 10 15 20
y
x
0 2 8 12
3
2
1
y x z 5 + =
8 = x
2 = + y x
12 4 = + y x
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
8
Every linear programming problem falls into one of the four categories:
Has an optimal solution if the optimal solution is achieved at only one feasible point.
Has multiple optimal solutions if the optimal solution is achieved at every point on the
boundary line joining two vertices of the feasible region.
Infeasible if a feasible solution to the linear programming problem does not exist.
Unbounded solutions if the constraints do not sufficiently restrain the objective
function so that for any given feasible solution, another feasible solution can be found
that makes a further improvement to the objective function.
Exercise 2
1. Given a linear programming problem
Maximize y x z 2 3 + =
subject to the constraints
10 2 > + y x
8 2 > + y x
0 > x
0 > y
(a) Graph the feasible region.
(b) Does the linear programming problem have a solution? Explain.
2. Given a linear programming problem
Minimize y x z 8 8 + =
subject to the constraints
5 > + y x
15 s + y x
10 s x
10 s y
0 > x
0 > y
(a) Graph the feasible region.
(b) Determine the optimal solution.
3. Determine the optimal solution for each of the linear programming problems in Exercise 1.
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
9
( B) The Simplex Method
The simplex method allows us to solve problems that cannot be solved geometrically (when the
number of variables increases to three or more). The simplex method solves linear programming
problems in iterations where the same computational steps are repeated a number of times before
the optimal solution is reached.
Advantages of the simplex method:
Completely mechanical (use matrices, elementary row operations, and basic arithmetic).
Can solve linear programming problems having any number of variables and constraints.
To use the simplex method, the linear programming problem must be in the standard form.
For maximization problem, all the constraints (other than the non-negative conditions),
are of the type s with non-negative right-hand side.
For minimization problem, all the constraints are of the type > with non-negative right-
hand side.
All the variables are non-negative.
The objective function may be maximization or minimization.
The simplex method requires that all the constraints be written in the form of equations.
A constraint of the type s ( >) can be converted to an equation by adding a slack variable to
(subtracting a surplus variable from) the left side of the constraint.
For example, in the constraint
6 2 s + y x
we add a slack variable,
1
s , to the left side to obtain the equation
6 2
1
= + + s y x , 0
1
> s
Consider the constraint
5 3 2 3 > + z y x
we subtract a surplus variable,
2
s , from the left side to obtain the equation
5 3 2 3
2
= + s z y x , 0
2
> s
Example 6:
Consider the linear programming problem
Maximize y x P + = 3
subject to the constraints
0
0
12 3 2
8 2
>
>
s +
s +
y
x
y x
y x
Rewrite the constraints and objective function in the standard form.
0 3
12 3 2
8 2
= +
= + +
= + +
P y x
s y x
r y x
where 0 , , , > s r y x .
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
10
Follow the steps of the simplex algorithm:
1. Set up the initial simplex tableau.
Basic x y r s P Solution
r 2 1 1 0 0 8
s 2 3 0 1 0 12
P -3 -1 0 0 1 0
Indicators
We have taken as the initial basic feasible solution 0 = x , 0 = y , 8 = r , 12 = s , and thus
0 = P . The variables set equal to zero (x and y) are called non-basic variables; the remaining
ones (r and s) are called basic variables.
2. Look for the most negative indicator (-3 in this case). So x is selected as an entering variable
(become basic variable). The x-column is called the pivot column.
3. Find the ratio ( 0 > )
Basic x Solution (Ratio)
r 2 8 (8 2 = 4)
s 2 12 (12 2 = 6)
Thus, r will be the departing variable (become non-basic variable). The r-row is called the pivot
row, and 2 is called the pivot element.
4. Use elementary row operations to transform the tableau into a new equivalent tableau that
has a 1 where the pivot element was and 0 elsewhere in that column.
Basic x y r s P Solution
r 2 1 1 0 0 8
s 2 3 0 1 0 12
P -3 -1 0 0 1 0
Basic x y r s P Solution
x 1
2
1
2
1
0 0 4
s 2 3 0 1 0 12
P -3 -1 0 0 1 0
Basic x y r s P Solution
x 1
2
1
2
1
0 0 4
s 0 2 -1 1 0 4
P 0
2
1
2
3
0 1 12
All indicators 0 >
Repeat the process until all the indicators are non-negative. Then, P is optimum.
Hence, the maximum value of P is 12 when 4 = x and 0 = y .
1 2
1
R
2 1
2 R R + ,
3 1
3 R R +
Choose the smallest (4)
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
11
Exercise 3
1. Construct the initial simplex tableau for the linear programming problem.
Maximize the objective function,
y x P 15 24 + =
subject to the constraints
0
0
240 10 20
40 2 3
>
>
s +
s +
y
x
y x
y x
2. Given the initial simplex tableau as:
Basic x y r s t P Solution
r 1 1 1 0 0 0 20
s 2 1 0 1 0 0 35
t -3 1 0 0 1 0 12
P -5 -4 0 0 0 1 0
a) State the initial basic feasible solution.
b) Identify the pivot column, pivot row, and hence the pivot element.
c) State the entering variable and the departing variable.
3. Use the following initial simplex tableau, find the maximum value of P.
Basic x y r s P Solution
r 3 4 1 0 0 12
s 5 2 0 1 0 5
P -9 -12 0 0 1 0
4. Find the optimum solution for the linear programming problem.
Maximize
3 2 1
4 x x x z =
subject to the constraints
0 , ,
2
4 3
3 2 1
3 2 1
3 2 1
>
s + +
s +
x x x
x x x
x x x
5. A company manufactures two models of the same product and the final part of the
manufacturing process consists of assembling and polishing operations. For each model, the time
(in hours) required for each operation is shown below, together with the profit per unit sold.
Assembling Polishing Profit (RM)
Model 1 7 5 500
Model 2 4 2 250
Given the current state of the labour force, the company estimates that each month they have
110 hours of assembling time and 70 hours of polishing time available.
Use the simplex method, determine the number of units of each model that the company
should make per month to maximize the profit. Hence, find the maximum profit.
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
12
Review Problems
1. Solve the following linear programming problem by using graphical method.
Minimize : y x K 5 4 + =
Subject to: 12 3 2 > + y x
0 , 0
5
10 5
> >
> +
> +
y x
y x
y x
2. A coffee bean factory wishes to package no more than 1000 kg of coffee beans into 1 kg
and 2 kg packets every week. The number of 1 kg packets must not be more than two times the
number of 2 kg packets and the factory must produce at least 500 packets of coffee beans every
week. The profit of 1 kg packet is RM2.00 and a 2 kg packet is RM3.50.
(a) Formulate the problem as a linear programming model to find the number of 1 kg
packets and 2 kg packets that the factory should produce to maximize the profit.
(b) Using graphical method, show the feasible region and solve the linear programming
problem.
3. A garden requires at least 6, 12 and 10 units of nutrients A, B and C respectively. A bottle
of liquid fertilizer contains 1, 4 and 1 units of nutrients A, B and C respectively. A bag of dry
fertilizer contains 1, 1 and 5 units of nutrients A, B and C respectively. Suppose that a bottle of
liquid fertilizer costs RM20 and a bag of dry fertilizer costs RM15.
(a) Formulate a linear programming problem to minimize cost within the constraints.
(b) Using the graphical method, determine the number of bottles of liquid fertilizer and
the number of bags of dry fertilizer which the gardener should buy to minimize the cost and find
this minimum cost.
4. A manufacturer wants to maximize the profit for two products. Product I yields a profit of
RM1.50 per unit, and Product II yields a profit of RM2.00 per unit. Market tests and available
resources have indicated the following constraints.
(a) The combined production level should not exceed 1200 units per week.
(b) The demand for Product II is less than or equal to half of the demand for Product I.
(c) The production level of Product I must exceed that of Product II by more than 200
units.
Using the graphical method, determine the number of Product I and the number of Product
II which give the maximum profit within the constraints and find this maximum profit.
5. Use the simplex method to find the maximum value of the function
2 1
20 10 x x P + =
subject to the following system of linear equations:
30 3 3
3 2 1
= + + x x x
48 4 2
4 2 1
= + + x x x
40 4
5 2
= + x x
18
6 2
= +x x
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
13
6. A house wife has 30 kg of nuts and 20 kg of raisins to be mixed and sold as two different
packages, A and B. One packet of A requires 2 kg of nuts and 1 kg of raisins. One packet of B
requires 3 kg of nuts and 4 kg of raisins. The profit for a packet of A is RM18 and the profit for a
packet of B is RM24.
Formulate the problem as a linear programming problem and use the simplex method to
find the maximum profit.
7. A company produces three types of oven: type I, type II and type III. Each type of oven
needs to pass through three processes: assembling, testing and packaging. The profits for a type I
oven, a type II oven and a type III oven are RM180, RM150 and RM100 respectively. The table
below shows the number of hours required to produce a type I oven, a type II oven and a type III
oven and the number of man-hours available per week.
Process
Number of hours required Number of man-hours
available per week Type I Type II Type III
Assembling 5 4 3 400
Testing 3 2 2 250
Packaging 1 1 1 70
(a) Formulate the problem as a linear programming problem.
(b) Using the simplex method, find the number of each type of oven to be produced to
maximize the weekly profit and find this maximum profit.
8. A company produces three products X, Y and Z. The table below shows the components
used in the manufacturing of the products.
Product
Mass (kg) required per unit of product
Aluminium Alloy Zinc
X 2 2 2
Y 3 1 1
Z 1 2 1
The company has 6500 kg of aluminium, 6000 kg of alloy and 5000 kg of zinc.
The profits for each unit of the products X, Y and Z are RM90, RM50 and RM70
respectively.
Formulate the above problem as a linear programming problem and find the maximum
profit using the simplex method.
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
14
STPM 2012
An investor has RM5 million to invest in corporate bond, fixed deposit and unit trust. The
interest rate and maximum investment allowed are as follows.
Type of investment Interest rate (%) Maximum investment allowed (RM million)
Corporate bond 7 1.0
Fixed deposit 3 2.5
Unit trust 11 1.5
(a) Formulate a linear programming problem to maximise total interest earned within the
constraints. [5]
(b) Using the simplex method, find the optimal amount for each type of investment and the
total interest earned. [9]
(c) State whether the RM5 million is fully utilised. Explain your answer. [2]
STPM 2011
A food company produces a cereal from several ingredients. The cereal is enriched with vitamins
A and B which are provided by two of the ingredients, oats and rice. A 1 g of oats contributes
0.32 mg of vitamin A and 0.08 mg of vitamin B, whereas 1 g of rice contributes 0.24 mg of
vitamin A and 0.12 mg of vitamin B. Each box of cereal produced has to meet the minimum
requirements of 19.20 mg of vitamin A and 7.20 mg of vitamin B. The cost of 1 kg of oats is
RM5 and the cost of 1 kg of rice is RM4. The company wants to determine how many grams of
oats and rice are to be included in each box of cereal in order to minimise cost.
(a) Formulate a linear programming model for the problem to minimise the cost. [5]
(b) Using a graphical method, determine how many grams of oats and rice are included in
each box of cereal to minimise cost, and find this minimum cost. [8]
STPM 2010
A chemical company produces two types of organic fertilisers at its factory. Three types of raw
materials P, Q and R are mixed to produce Type X and Type Y fertilisers. Each ton of Type X
fertiliser is a mixture of 0.4 ton of P and 0.6 ton of R, while each ton of Type Y fertiliser is a
mixture of 0.5 ton of P, 0.2 ton of Q and 0.3 ton of R. The profit yields for each ton of Type X
and Type Y fertilisers are RM400 and RM300 respectively. The quantities of raw materials
useable per week are shown in the following table.
Raw material Quantity of material useable per week (tons)
P 20
Q 5
R 21
(a) If x and y represent the quantities, in tons, of Type X and Type Y fertilisers produced
each week, formulate a linear programming model that can be used in order to maximise total
profit per week. [4]
(b) Construct the initial tableau for the linear programming model. [2]
(c) Based on the following final tableau, state the quantity of each type of fertiliser that
should be produced per week in order to maximise the total profit, and calculate the total profit.
Basic x y s
1
s
2
s
3
Solution
y 0 1
3
10
0
9
20
20
s
2
0 0
3
2
1
9
4
1
x 1 0
3
5
0
9
25
25
[2]
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
15
STPM 2009
An electronics company manufactures LCD televisions of models P and Q. Each unit of
model P requires 3.5 hours of production time, 1 hour of assembly time and 1 hour of packing
time. Each unit of model Q requires 8 hours of production time, 1.5 hours of assembly time and
1 hour of packaging time. The maximum available resources for each process in a day are as
follows:
Process Resource available per day
(hours)
Production 280
Assembly 60
Packaging 50
The manager of the company wishes to maximise profit. Each unit of P yields a profit of
RM400 while each unit of Q yields a profit of RM800. Due to high demand, the company has to
produce at least 10 units of each model per day.
(a) If x and y represent the quantities of models P and Q produced each day respectively,
formulate the problem as a linear programming problem. [5]
(b) Plot a graph for the above problem, and shade the feasible region. [7]
(c) Using the graph that you have plotted in (b),
(i) determine the quantity of the daily production for each model which gives the
maximum profit, [1]
(ii) find the daily maximum profit. [2]
STPM 2008
A factory assembles three models of chairs using six components. The following table shows
the number of units of components needed for each model and the total units of components
available per wee.
Component
Number of units of components Total units of components
available per week
Model P Model Q Model R
Type 1 seat 1 0 0 500
Type 2 seat 0 1 1 1000
Chair frame 1 1 1 1000
Chair leg 4 4 4 4000
Type 1 backrest 1 1 0 1000
Type 2 backrest 0 0 1 500
The profits for models P, Q and R are RM35, RM40 and RM50 per unit respectively. The
manager of the factory wishes to determine the number of chairs of each model to be produced
per week in order to maximize the total profit.
(a) If
1
x ,
2
x and
3
x represent the numbers of chairs of models P, Q and R respectively,
formulate a linear programming model to determine the number of chairs of each model that
should be produced per week in order to maximize the total profit. [5]
(b) Construct the initial tableau for the linear programming problem. [4]
(c) Based on the final tableau given below, state the number of chairs of each model that
should be produced per week in order to maximize the total profit, and calculate the maximum
total profit. [4]
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
16
Basic x
1
x
2
x
3
s
1
s
2
s
3
s
4
s
5
s
6
Solution
s
1
0 0 0 1 1 1 0 0 0 500
x
2
0 1 0 0 1 0 0 0 1 500
x
1
1 0 0 0 1 1 0 0 0 0
s
4
0 0 0 0 0 4 1 0 0 0
s
5
0 0 0 0 0 1 0 1 1 500
x
3
0 0 1 0 0 0 0 0 1 500
STPM 2007
A factory produces two types of batteries A and B. Every unit of battery A requires 2 hours of
assemble and 1 hour of testing, whereas every unit of battery B requires 2.5 hours of assembly
and 1.5 hours of testing. The factory has at most 500 hours of assembly per week and at most
300 hours of testing per week. It is specified that the number of battery B produced per week
exceeds the number of battery A produced per week and that the number of battery A produced
per week exceeds 50 units. The profits for battery A and battery B are RM80 and RM90 per unit
respectively.
(a) Formulate the above problem as a linear programming problem to maximize the profit.
[6]
(b) Using the graphical method, determine the number of battery A and the number of
battery B that should be produced per week and find the maximum profit per week. [10]
STPM 2006
A computer manufacturing company produces three types of computer: home desktop,
business desktop and notebook. Each type of computer needs to pass through three processes:
assembling, testing and packaging. The profits for a home desktop, a business desktop and a
notebook are RM200, RM350 and RM450 respectively. The table below shows the number of
hours required to produce a home desktop, a business desktop and a notebook and the number of
man-hours available per week.
Process Number of hours required Number of man-hours
available per week
Home desktop Business desktop Notebook
Assembling 5 6 8 400
Testing 10 12 12 648
Packaging 2 4 2 60
(a) Formulate the problem as a linear programming problem [4]
(b) Using the simplex method, find the number of each type of computer to be produced to
maximise the weekly profit and find this maximum profit. [9]
TOPIC : LINEAR PROGRAMMING 950 / 3
Compiled by: Goh PC
17
STPM 2005
A company produces two types of lamps, A and B, which are made of three types of
materials: iron frame, electrical component and plastic component. Each lamp A requires 1 unit
of iron frame, 2 units of electrical components and 3 units of plastic components, whereas each
lamp B requires 3 units of iron frames, 2 units of electrical components and 1 unit of plastic
components. The company has 300000 units of iron frames, 300000 units of electrical
components and 400000 units of plastic components in stock. The profits made from each lamp
A and lamp B are RM15.00 and RM20.00 respectively.
(a) Formulate a linear programming problem to maximize profit within the constraints. [4]
(b) Using the graphical method, determine the number of lamp A and the number of lamp B
which give the maximum profit and find this maximum profit. [8]
STPM 2004
A chocolate manufacturer produces two types of chocolate bars of orange and strawberry
flavours. It costs RM0.22 to produce a 10 g orange-flavoured chocolate bar which is sold at
RM0.35, whereas it costs RM0.40 to produce a 15 g strawberry-flavoured chocolate bar which is
sold at RM0.55. The manufacturer has 426 kg of chocolate in stock. A minimum of 10000
orange-flavoured chocolate bars and 12000 strawberry-flavoured chocolate bars have to be
produced. The number of strawberry-flavoured chocolate bars produced has to be more than that
of orange-flavoured chocolate bars.
(a) Formulate a linear programming model that can be used to determine the number of
chocolate bars of each flavour that should be produced in order to maximize total profit. [6]
(b) Show the feasible region and hence solve the linear programming problem using the
graphical method. [9]
STPM 2003
A manufacturer of wooden furniture produces two types of furniture: chairs and tables. Two
machines are used in the production: a jigsaw and a lathe. Each chair requires 1 hour on the
jigsaw and 1 hour on the lathe, whereas each table requires 1 hour on the jigsaw and 2 hours on
the lathe. The jigsaw and lathe can operate 10 hours and 12 hours per day respectively. The
profit made is RM27.00 on a chair and RM48.00 on a table. The daily profit is to be maximized.
(a) Formulate the problem as a linear programming problem. [4]
(b) Using the simplex method, find the maximum daily profit and the numbers of chairs and
tables made which give this profit. [9]
STPM 2002
A factory produces two types of products, A and B. Each unit of product A requires 2 labour
hours and 1 machine hour, whereas each unit of product B requires 2 labour hours and 4 machine
hours. There are not more than 120 labour hours and not more than 96 machine hours available
in the factory each day. The factory also decided that the number of units of product B produced
each day should not be more than 60% of the total daily production of both products A and B.
The profit for each unit of A is RM120 and each unit of B is RM200. The factory intends to
maximize the total profit each day.
Formulate the problem as a linear programming problem. [6]
By using graphical method, determine the number of units of product A and product B that
should be produced daily in order to maximize the total profit, and find the maximum total daily
profit. [9]