Cetakan Pertama/First Printing 2021
Hak Cipta Politeknik Sultan Idris Shah
Copyright Politeknik Sultan Idris Shah, 2021
Politeknik Sultan Idris Shah
Hak cipta terpelihara. Tiada bahagian daripada buku ini boleh diterbitkan
semula, disimpan untuk pengeluaran atau ditukarkan ke dalam sebarang
bentuk atau dengan sebarang alat juga pun, sama ada dengan cara elektronik,
gambar serta rakaman dan sebagainya tanpa kebenaran bertulis daripada
Jabatan Matematik, Sains & Komputer Politeknik Sultan Idris Shah terlebih
dahulu.
All right reserved. No part of this publication may be reproduced or transmitted
in any form or by any means, electronic or mechanical including photocopy,
recording or any information storage and retrieval system, without permission
in writing from Department of Mathematics, Science & Computer, Politeknik
Sultan Idris Shah.
Perpustakaan Negara Malaysia Cataloguing-in-Publication Data
Muhammad Daniel Derome, 1985-
LINEAR PROGRAMMING : A Step by Step Handbook / Muhammad Daniel Bin
Derome, Norsuzana Binti Zakaria. - First Edition.
Mode of access: Internet eISBN 978-967-2860-23-5
1. Linear programming.
2. Programming (Mathematics).
3. Government publications--Malaysia.
4. Electronic books.
I. Norsuzana Zakaria, 1981-.
II. Title.
519.72
Diterbitkan di Malaysia oleh/Published in Malaysia by
POLITEKNIK SULTAN IDRIS SHAH
Sungai Lang, 45100 Sungai Air Tawar, Selangor Malaysia
No. Tel: 03 3280 6200, No. Fax : 03 3280 6400
https://psis.mypolycc.edu.my/
ACKNOWLEDGEMENT In the name of Allah, the Most Gracious and the Most
Merciful. Alhamdulillah, all praises to Allah for the
strengths and His blessing in completing this book. The
aim of writing this book is to provide a module on how
to learn Linear Programming for polytechnic students
taking mathematics. We hope that this book will be a
good reference for them throughout the semester.
This book is not a substitute for lectures but to
complement the lectures given. No ivory is not cracked.
The author realizes that the compilation of this book is
far from perfect and may not be able to satisfy all
parties. Therefore, any positive feedback from lecturers
and students is most welcome and appreciated.
We wish to express our gratitude to the Head of
Department, Puan Rasidah Binti Sapri, for her
encouragement and general advice in carrying out this
book. Finally, we would like to express our deepest
gratitude to our beloved family and all staff of
Mathematics, Science and Computer Department staff
who have always been there. We are thankful for the
constant support and help.
Authors
Muhammad Daniel Bin Derome
Mathematics, Science and Computer Department,
Politeknik Sultan Idris Shah.
Nov 2021.
Norsuzana Binti Zakaria
Mathematics, Science and Computer Department,
Politeknik Sultan Idris Shah.
Nov 2021.
Linear
Programming
CONTENTS 1.0 Introduction 02
Definitions of the term in LP 03
1.1 State the objective function 04
Exercise 1.1 06
1.2 State the constrain / linear inequalities 07
Exercise 1.2 13
1.3 Types of method to solve the Linear 14
Programming problems
15
1.4 Graphical Method (GM) 22
1.4.1 Terms used in Graphical Method 24
1.4.2 Problem involving the Graphical
Method 24
Example 1 26
Example 2 28
Example 3 30
Example 4 32
Example 5 35
Exercise 1.4
37
1.5 Simplex Method 38
Example 1 40
Example 2 43
Example 3 46
Example 4 50
53
Exercise 1.5
Reference
02
1.0 Introduction
Linear Programming (LP) optimises a linear objective function
subject to a system of linear inequalities called constraints.
A simple Linear Programming problem may look like this:
= 6 + 5 -------- objective function
Subject to the following constraints
≤3 constraint
3 − ≤2
2 + ≤ 10
≥0
≥0
*** The last two constraints x ≥ 0; y ≥ 0 apply to ALL linear
programming and indicate that the problem variable, x and y
are restricted to non-negative values; they may have zero or
positive values but negative values.
Scan this QR code to get an introductory
video on Linear Programming
LINEAR PROGRAMMING
A Step By Step Handbook
03
Definition of terms in LP
Objective Function A single linear objective function to
Problem Constraints MAXIMISE or MINIMISE.
The objective function represents
cost, profit, or other quantity to be
maximised minimised subject to the
constraints. All objective function
problems have the following
operational characteristics : maximise
profit, minimise production cost,
minimise product and maximise
return.
The linear inequalities are derived
from the application. It has also been
known as "subject to."
For example, let be only 40 hours a
machine can be used in a week, so
the total time used would have to be
≤ 40. The problem constraints are
usually stated in the story problem.
Non-Negativity Constraints The linear inequalities ≥ 0 and ≥ 0.
These are included because and
are usually the numbers of items
produced and cannot produce a
negative number of items. The
smallest number of items could
produce zero. These are not (usually)
stated; they are implied.
LINEAR PROGRAMMING
A Step By Step Handbook
04
1.1 State the objective function
Example 1 Proton produces two models of car, Satria-type R and
Inspira-type R. The company produces Satria-type R and
Inspira-type R per day. If each Satria-type R car is sold
for RM150000 and each Inspira-type R car is sold for
RM162000, write the objective function representing the
company's total sales per day.
Step 1 : Define the variables
= the number of Satria-type R sold
= the number of Inspira-type R sold
= total sales
Step 2 : Solution [Objective function]
Maximize S = 150000 + 162000
Example 2 Arni Satay Sdn Bhd produces two XXL products, i.e., jumbo
chicken satay and jumbo meat satay. The profit margin is
RM5 per jumbo chicken satay and RM10 per jumbo meat
satay. The main goal of the management of the company
is to maximise the total profit of the company. Write the
objective function representing the total profit of the
company.
Step 1 : Define the variables
= the number of jumbo chicken satay
= the number of jumbo meat satay
= total profit
Step 2 : Solution [Objective function]
Maximize = 5 + 10
LINEAR PROGRAMMING
A Step By Step Handbook
05
Example 3 Danisha Oven is considering selling two different types of
cookies, & . The cookies cost the company RM1.50
per kilogram while brand cookies cost RM1.80 per
kilogram. The company aims to determine the lowest
cost. Write the objective function representing the aim of
the company.
Step 1 : Define the variables
= the number of cookies
= the number of cookies
= costs the company
Step 2 : Solution [Objective function]
Maximize = 1.5 + 1.8
LINEAR PROGRAMMING
A Step By Step Handbook
06
Exercise 1.1
1. Mr. Amrullah intends to buy boxes of black pens and boxes of
blue pens for use in his office. If each box of black pens costs RM25
and each box of blue pens costs RM18, find the maximum cost to
buy the pens. Ans: Maximise = 25 + 18
2. Upin & Ipin Company makes and sells two types of shampoos, grape
and peach, making a profit of RM15 and RM20, respectively. The
company aims to maximise profit. Write the objective function
representing the aim of the company. Ans: Maximise = 15 + 20
3. The JPAM association of a polytechnic plan to organise an outdoor
expedition to a forest reserve. The organising committee decided to
rent type A buses and type B buses with different capacities.
The number of participating members that can be accommodated
into the buses is 45 passengers for type A bus and 22 passengers for
type B bus. Write the objective function representing the maximum
number of participating members that can be accommodated into
the buses. Ans: Maximise = 45 + 22
4. A tuition center enrolls students for Mathematics and students
for Additional Mathematics. The monthly fees for students for
Mathematics and Additional Mathematics are RM30 and RM50,
respectively. Write an objective function representing the total fees
collected by the tuition center per month. Ans: Maximise = 30 + 50
5. A club has silver members and gold members. If the annual
subscription fee of a silver member is RM500 and that of a gold
member is RM1200, write the objective function representing the
total subscription fee collection of the club per year.
Ans: Maximise = 500 + 1200
6. Halim buys English dictionaries and Korean dictionaries. If an
English dictionary costs RM35 and the Korean dictionary costs
RM30, write an objective function representing the total cost of Ali's
dictionaries. Ans: Maximise = 35 + 30
LINEAR PROGRAMMING
A Step By Step Handbook
1.2 State the constraints/ 07
linear inequalities
NO CONSTRAINT DESCRIPTION MATHEMATICAL
EXPRESSIONS
1. y is greater than x
2. is less than x >
<
is more than or equal to x
3. is at least x ≥
is not less than x ≤
is less than or equal to x
4. is at most x ≤
is not more than x ≥
5. is at most k times of x + ≤
6. is at least k times of x + ≥
7. + has a maximum value of m – ≥
8. + has a minimum value of m + ≤
is at least more than x by m
≥
9.
exceeds x at least by m
10. The total of x and is not more than k
11. The ratio of to x is at least m:n
LINEAR PROGRAMMING
A Step By Step Handbook
08
Example 1 A charitable organisation by Ebit Lew Enterprise is hosting
a charity, and the organisation's members hope to bring in
at least RM6600. Standard tickets are available for RM22
each, whereas VIP tickets are for RM33 each. Write an
inequality that describes this situation.
Step 1 : Define the variables
= the number of standard tickets
= the number of VIP tickets
Step 2 : Solution
22 + 33 ≥ 6600
≥ 0
≥ 0
Example 2 DAS Maritime & Travel aims to collect at most RM2400 in
baggage fees from passengers every day. Passengers are
charged RM40 for each regular suitcase and RM60 for
each overweight suitcase. Write an inequality that
describes this situation.
Step 1 : Define the variables
= the number of regular suitcases
= the number of overweight suitcases
Step 2 : Solution
40 + 60 ≤ 2400
≥ 0
≥ 0
LINEAR PROGRAMMING
A Step By Step Handbook
09
Example 3 The hostel students are selling burgers and sandwiches to
raise money for a piece of new equipment for their study.
They will earn RM2 for every burger they sell. Each set of
sandwiches they sell will earn them RM3. They need to
raise a minimum of RM1000 to have enough money to buy
the new equipment. Write an inequality that describes this
situation.
Step 1 : Define the variables
= the number of burgers they sell
= the number of sandwiches they sell
Step 2 : Solution
2 + 3 ≥ 1000
≥ 0
≥ 0
Example 4 The PSIS Chef Club is organising a lunch set to raise
money to help those in need during PKP. They need to
make at least RM1000 to cover the costs of the camp.
Tickets for the fish lunch sell for RM25 each. Those people
who do not like fish can purchase the meat lunch ticket
for RM20 each. Write an inequality that describes this
situation.
Step 1 : Define the variables
= the number of fish lunches sold
= the number of meat lunches sold
Step 2 : Solution
25 + 20 ≥ 1000
≥ 0
≥ 0
LINEAR PROGRAMMING
A Step By Step Handbook
10
Example 5 The cost of an eraser is RM1.00 and that of a pen is
RM2.00. A student wants to buy erasers and pens with
the following conditions:
i. At least two pens must be bought
ii. The total number of erasers and pens bought must not
be more than 10
iii. The amount of money spent is at most RM11
State 3 inequalities other than ≥ 0 and ≥ 0 that
satisfy all the above conditions.
Step 1 : Define the variables (already given in sentences)
= the number of erasers bought
= the number of pens bought
Step 2 : Solution
i. ≥2
ii. + ≤ 10
iii. + 2 ≤ 11
LINEAR PROGRAMMING
A Step By Step Handbook
11
Example 6 The prices for one box of black pens and one box of blue
pen are RM10 and RM15 respectively. Mr. Amrullah intends
to buy boxes of black pens and boxes of blue pens for
use in his office. Write the inequalities based on the given
conditions.
a. Mr. Amrullah must buy at most 100 boxes of pens.
b. The number of boxes of blue pens must be at least half
of the boxes of black pens.
c. Mr. Amrullah must buy not more than 50 boxes of
black pens.
d. Mr. Amrullah buys at most 30 boxes of blue pens.
e. Mr. Amrullah has only RM200 to buy all the pens.
f. Mr. Amrullah has only RM120 to buy boxes of black
pens.
g. The whole box of blue pens that Mr. Amrullah can buy
is 25.
h. The total number of boxes of black pens and boxes of
blue pens is at least 45.
i. The ratio of boxes of black pens and boxes of blue
pens is at least 41:35.
j. The number of boxes of black pens is at least three
times that of the boxes of blue pens.
State all inequalities other than ≥ 0 and ≥ 0 that
satisfy all the above conditions.
LINEAR PROGRAMMING
A Step By Step Handbook
12
Step 1 : Define the variables (already given in sentences)
= the boxes of black pen
= the boxes of blue pen
Step 2 : Solution
a. + ≤ 100
1
b.
≥ 2
c. ≤ 50
d. ≤ 30
e. 10 + 15 ≤ 200
f. 10 ≤ 120
g. ≤ 25
h. + ≥ 45
41
i. ≥ 35
j. ≥ 3
LINEAR PROGRAMMING
A Step By Step Handbook
13
Exercise 1.2
1. Ashraf buys some educational games and entertainment games.
An education game costs RM80.00 and an entertainment game
costs RM35.00. Using to represent the number of educational
games and to represent the number of entertainment games, write
equality for each of the following situations:
a) The number of educational games is at least two times the
number of entertainment games
b) Ashraf has only RM35 to buy all the CDs. Answer: ≥ 2
c) Ashraf buys at most 40 CDs. a)
b) 80 + 35 ≤ 35
c) + ≥ 40
2. A tanker carries liters of petrol and liters of diesel. If each liter of
petrol is 1 kg and each liter of diesel is 1.5 kg, write an inequality for
each of the following situations:
a) The tanker can carry at most 1500 liters of petrol and diesel.
b) The total mass of petrol is not more than that of diesel.
c) The maximum load of the tanker is 4000 kg. Answer: ≤ 1500
a) +
b) ≤ 1.5
c) + 1.5 ≤ 4000
3. A mathematic test paper contains moderate questions and
difficult questions. Write an inequality for each of the following
situations:
a) There are at least 20 moderate questions in the paper.
b) The number of difficult questions is at most 30% of the number
of moderates questions.
c) If one moderate question is given two marks and one difficult
question is given five marks, the total marks of the paper should
not exceed 60 marks. Answer:
a) ≥ 20
b) ≤ 0.3
c) 2 + 5 ≤ 60
LINEAR PROGRAMMING
A Step By Step Handbook
14
1.3 Types of method to solve
Linear Programming problems
1 Graphical Method
Linear Example
Programming
2 Simplex Method
*** Both methods will give the same answer
Figure 1 : Methods in solving Linear Programming (LP) problems
LINEAR PROGRAMMING
A Step By Step Handbook
15
1.4 Graphical Method (GM)
The Graphical Tips & hints for easy to draw
Method of linear the constraints
programming 1. First, we need at least two
solves problems coordinates from each equation.
by finding the To find the coordinates, insert a
highest or lowest
random value for either or .
point of
intersection Solving the equation after
between the inserting the random values could
objective function then be used to find the value of
line and the the other coordinate.
feasible region on
2. For example, we can find the
a graph.
value of when = 0 by
inserting zero in place of and
solving the equation as follows:
When = 0 then =? and
When = 0 then =?
Once the two coordinates of the
equation are determined, mark them
on the graph and draw a straight line
across them, as shown below:
*** In order to get a good estimation,
we should sketch it on graph paper.
LINEAR PROGRAMMING
A Step By Step Handbook
16
Example 1 Draw the linear equation and shade the region.
≥ 5
(Graphing Calculator - GeoGebra, 2019)
Example 2 Draw the linear equation and shade the region.
≤ 3
LINEAR PROGRAMMING
A Step By Step Handbook
17
Example 3 Draw the linear equation and shade the region.
+ ≤ 4
First of all, we need at least two coordinates from
the equation.
When = 0 then = 4 and
When = 0 then = 4
Then the two coordinates are (0, 4) and (4, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
18
Example 4 Draw the linear equation and shade the region.
+ 2 ≥ 6
First of all, we need at least two coordinates from
the equation.
When = 0 then = 3 and
When = 0 then = 6
Then the two coordinates are (0, 3) and (6, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
19
Example 5 Draw the linear equation and shade the region.
+ 2 ≥ 4
+ ≤ 6
First of all, we need at least two coordinates from
the equation.
Let + ≥ be Eqn.1
When = 0 then = 2 and
When = 0 then = 4
Then the two coordinates are (0, 2) and (4, 0).
Let + ≤ be Eqn.2
When = 0 then = 6 and
When = 0 then = 6
Then the two coordinates are (0, 6) and (6, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
20
Example 6 Draw the linear equation and shade the region.
≤ 4
2 + 5 ≥ 10
First of all, we need at least two coordinates from
the equation.
Let ≤ be Eqn.1
Let + ≥ be Eqn.2
When = 0 then = 2 and
When = 0 then = 5
Then the two coordinates are (0, 2) and (5, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
21
Example 7 Draw the linear equation and shade the region.
≥ 3
3 + 5 ≥ 15
First of all, we need at least two coordinates from
the equation.
Let ≥ be Eqn.1
Let + ≥ be Eqn.2
When = 0 then = 3 and
When = 0 then = 5
Then the two coordinates are (0, 3) and (5, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
22
1.4.1 Terms used in Graphical Method
1. UNBOUNDED AD
REGION
B
A feasible region C
that cannot be
enclosed in a circle.
(Point ABCD)
EI 2. BOUNDED REGION
F
A feasible region that
can be enclosed in a
circle. A bounded
region will have both
maximum and
H minimum values.
(Point EFGHI)
G
LINEAR PROGRAMMING
A Step By Step Handbook
23
3. FEASIBLE REGION J
/ FEASIBLE M
SOLUTION
KL
The solution to the
system of linear
inequalities. That is
the set of all points
that satisfy all the
constraints. Only
points in the feasible
region can be used.
(Point JKLM)
4. OPTIMAL
SOLUTION
Z The solution to the
system of linear
inequalities. That is
the ONE point that
satisfies all the
constraints. Only
points in the feasible
region can be used.
(Point Z)
LINEAR PROGRAMMING
A Step By Step Handbook
24
1.4.2 Problem Involving Graphical Method
Example 1 Solve the equations below by using the Graphical Method.
Maximise = + 4
Subject to + 2 ≤ 6
5 + 4 ≤ 20
First, we need to find at least two coordinates from each
equation before drawing the graph.
Let + ≤ be Eqn.1
When = 0 then = 3 and
When = 0 then = 6
Then the two coordinates are (0, 3) and (6, 0).
Let + ≤ be Eqn.2
When = 0 then = 5 and
When = 0 then = 4
Then the two coordinates are (0, 5) and (4, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
25
D
C
AB
As mentioned earlier on the first page, the two constraints ≥ ; ≥
are applied to ALL linear programming and indicate that the problem
variable, and are restricted to non-negative values; they may have
zero or positive values but not negative values.
Therefore, the feasible solutions are A (0, 0), B (4, 0), C (2.6, 1.7) and D (0, 3).
Next, to find the maximum value of the function, as the last step, we need
to substitute the feasible solutions into the objective function.
Maximise = + 4
Point (0, 0) = 0 + 4(0) =0
(4, 0) = 4 + 4(0) =4
A (2.6, 1.7) = 2.6 + 4(1.7) =9.4
B (0, 3) = 0 + 4(3) =12 (Max)
C
D
In conclusion, the optimal solution is point D (0, 3) with a maximum value
of 12. ("Calculator of Graphical Method of Linear Programming Step by
Step.," n.d.)
LINEAR PROGRAMMING
A Step By Step Handbook
26
Example 2 Solve the equations below by using the Graphical Method.
Maximise = 3 + 4
Subject to ≤ 2
y≤4
− + 2 ≤ 6
First, we need to find at least two coordinates from each
equation before drawing the graph.
Let ≤ be Eqn.1
Let ≤ be Eqn.2
Let − + ≤ be Eqn.3
When = 0 then = 3 and
When = 0 then = −6
Then the two coordinates are (0, 3) and (-6, 0).
LINEAR PROGRAMMING
A Step By Step Handbook
27
D
A
BC
As mentioned earlier on the first page, the two constraints ≥ ; ≥
are applied to ALL linear programming and indicate that the problem
variable, and are restricted to non-negative values; they may have
zero or positive values but not negative values.
Therefore, the feasible solutions are A (0, 3), B (0, 0), C (2, 0) and D (2, 4).
Next, to find the maximum value of the function, as the last step, we need
to substitute the feasible solutions into the objective function.
Maximise = 3 + 4
Point (0, 3) = 3(0) + 4(3) =12
(0, 0) = 3(0) + 4(0) =0
A (2, 0) = 3(2) + 4(0) =6
B (2, 4) = 3(2) + 4(4) =22 (Max)
C
D
In conclusion, the optimal solution is point D (2, 4) with a maximum value
of 22.
LINEAR PROGRAMMING
A Step By Step Handbook
28
Example 3 A shop sells two types of handbags A and B. The shop can
sell bags A and bags B per day. The time taken to do
the final touch-up is 4 hours for bag A and 4 hours for bag
B. The sale of the bags per day is subject to the following
constraints:
i. The number of bags A is not more than 50.
ii. The number of bags B is not more than twice the
number of bag A by at most 20 bags.
iii. The total time taken to do the final touch-up should
not be more than 20 hours
Find the maximum profit if the profits from the sale of bag
A and bag B are RM25 and RM20, respectively. Solve the
questions by using the Graphical Method.
Step 1: Define the variables
= the number of bags A
= the number of bags B
= the profit gain
Step 2: State the objective function and linear inequalities
(constraints)
Objective function, max = 25 + 20
Constraints Eqn.1
Eqn.2
+ ≤ 50 Eqn.3
≤ 2 + 20
4 + 4 ≤ 20
≥ 0
≥ 0
LINEAR PROGRAMMING
A Step By Step Handbook
29
Step 3: Sketch the graph
B
C
A
Therefore, the feasible solutions are A (0, 0), B (0, 5) and
C (5, 0)
Step 4: Optimal solution
Next, to find the maximum value of the function, as the
last step, we need to substitute the feasible solutions
into the objective function.
Maximise = 25 + 20
Point (0, 0) = 25(0) + 20(0) = 0
(0, 5) = 25(0) + 20(5) = 100
A (5, 0) = 25(5) + 20(0) = 125 (Max)
B
C
In conclusion, the optimal solution is point C (5, 0) with
a maximum value of 125. On the others hand, the shop
should sell 5 of bag A and none of bag B to gain a
maximum profit of RM125 per day.
LINEAR PROGRAMMING
A Step By Step Handbook
30
Example 4 A breeder has 10 workers to take care of cow and goat. He
has to plan to use at least 7 workers. However, he has only
RM1200 to spend and a cow costs RM200 to take care and
a goat costs RM100. Moreover, the breeder has to get the
take care done in 12 hours and it takes an hour to take care
of a cow and 2 hours to take care of a goat. If the profit is
RM500 per cow and RM300 per goat, how many of each
cow and goat should be taken care to maximise profits?
Solve the questions by using the Graphical Method.
Step 1: Define the variables
= the number of cows
= the number of goats
= the profit gain
Step 2: State the objective function and linear inequalities
(constraints)
Objective function, max = 500 + 300
Constraints ≥7 Eqn.1
≤ 1200 Eqn.2
+ ≤ 12 Eqn.3
200 + 100
+ 2
≥ 0
≥ 0
LINEAR PROGRAMMING
A Step By Step Handbook
31
Step 3: Sketch the graph
AC
B
Therefore, the feasible solutions are A (2, 5), B (5, 2) and
C (4, 4)
Step 4: Optimal solution
Next, to find the maximum value of the function, as the
last step, we need to substitute the feasible solutions
into the objective function.
Maximise = 500 + 300
Point (2, 5) = 500(2) + 300(5) = 2500
(5, 2) = 500(5) + 300(2) = 3100
A (4, 4) = 500(4) + 300(4) = 3200 (Max)
B
C
In conclusion, the optimal solution is point C (4, 4) with a
maximum value of 3200. On the other hand, the
breeder should take care 4 cows and 4 goats to
maximise profit RM3200.
LINEAR PROGRAMMING
A Step By Step Handbook
32
Example 5 Solve the equations below using the Graphical Method.
Minimise = 10 + 12
Subject to
≥ + 2
2 + ≥ 4
+ 2 ≤ 10
≥ 0.75
First, we need to find at least two coordinates from each
equation before drawing the graph.
Let ≥ + be Eqn.1
When = 0 then = −2 and
When = 0 then = 2
Then the two coordinates are (0, -2) and (2, 0).
Let + ≥ be Eqn.2
When = 0 then = 4 and
When = 0 then = 2
Then the two coordinates are (0, 4) and (2, 0).
Let + ≤ be Eqn.3
When = 0 then = 5 and
When = 0 then = 10
Then the two coordinates are (0, 5) and (10, 0).
Let ≥ . be Eqn.4
LINEAR PROGRAMMING
A Step By Step Handbook
33
Next proceed with sketching the graph.
A C
B
As mentioned earlier on the first page, the two constraints
≥ 0; ≥ 0 are applied to ALL linear programming and
indicate that the problem variable, and are restricted to
non-negative values; they may have zero or positive values
but not negative values.
Therefore, the feasible solutions are A (4.7, 2.6), B (2.75, 0.75)
and C (8.5, 0.75)
LINEAR PROGRAMMING
A Step By Step Handbook
34
Next, to find the maximum value of the function, as the last
step, we need to substitute the feasible solutions into the
objective function.
Minimise = 4 + 3
Point = 10(4.7) + 12(2.6) = 78.2
= 10(2.75) + 12(0.75) = 36.5 (Min)
A (4.7, 2.6) = 10(8.5) + 12(0.75) = 94
B (2.8, 0.75)
C (8.5, 0.75)
In conclusion, the optimal solution is point B (2.75, 0.75) with
a minimum value of 36.5.
LINEAR PROGRAMMING
A Step By Step Handbook
35
Exercise 1.4
1. Solve the following linear programming problem.
Minimise = 3 + 4
Subject to 2 + 3y ≥ 150
3 + ≥ 100
≤ 4 Ans:
Optimal solution = 150 , 250
min
77
= 1350
7
2. Solve the following integer programming problem.
Maximise = +
Subject to + 3y ≤ 500
3 + ≤ 500
5 + 4y ≤ 1000 Ans:
Optimal solution = 1000 , 1500
max
11 11
= 2500
11
3. Solve the following integer programming problem.
Maximise = 5 + 8
Subject to 2 + 3y ≤ 20
+ 4 ≤ 23
Ans:
Optimal solution = 11 , 26
max
55
= 263
5
LINEAR PROGRAMMING
A Step By Step Handbook
36
4. A human resource development center offers two types of courses A
and B for executives. The operation of the center is subject to the
following constraints:
i. The total number of enrolments for two courses is at most 300.
ii. The number of enrolments for course A must not be less than that
of course B.
iii. The number of enrolments for course B must be at least 100.
If course A and course B fees are RM300 and RM200 respectively, find
the maximum collection of fees.
Ans:
Optimal solution = 200 , 100
max = 80000
5. A factory assembles two models of DVD players, P and Q. Model P
requires 2 hours to assemble, whereas model Q requires 6 hours. The
factory assembles x units of model P and y units of model Q per day.
The operation of the factory is subject to the following constraints:
i. The assembly line has a maximum capacity of 800 units of DVD
players per day.
ii. The minimum available labor per day is 2000 hours.
iii. The number of units of model P assembled must be at least 3/5 of
that model Q.
Find the maximum total profit made by the factory per day if the
profit on each sale of model P is RM40 and that of model Q is RM90.
Ans:
Optimal solution = 300 , 500
max = 57000
LINEAR PROGRAMMING
A Step By Step Handbook
37
1.5 Simplex Method
Step by step of Simplex Method
Convert the linear programming problems into standard form.
1 If ≤, the entered variable s is called slack variables.
If ≥ , the entered variable is a and s where a is called artificial
variables AND s is called slack variables.
2 Construct the first initial tableau.
Choose the entering variable [column by selecting the most negative
3 entry in the index row (max objective function) or selecting the most
positive entry in the index row (min objective function)]
Choose the leaving variable [row by dividing solution with the positive
4 entry in the column and then select the lowest value].
=
5 Choose the pivot (intersection between key column and row-column).
6 Convert the pivot to 1 if needed, so does the whole row.
7 Change the remaining row [old number – (corresponding entries in
the main row x corresponding entries in the key column)]
Continue step (3-7) until there is no negative value in the index row
8 for maximum objective, no positive value in the index row for a
minimum objective.
LINEAR PROGRAMMING
A Step By Step Handbook
38
Example 1 Solve the equations below by using the Simplex Method.
Maximise = + 4
Subject to + 2 ≤ 6
5 + 4 ≤ 20
Step 1 : Convert to standard form
− − 4 = 0
+ 2 + 1 = 6
5 + 4 + 2 = 20
Step 2: Construct the initial tableau Solution
0
6
-1 -4 0 0 20
1210
5401
Step 3: Choose the column (entering variable)
Solution
-1 -4 0 0 0
1210 6
5401 20
Step 4: Choose the row (leaving variable)
=
Solution Ratio
-1 -4 0 0 0 -
1210 6 3
5401 20 5
LINEAR PROGRAMMING
A Step By Step Handbook
39
Step 5: Choose the pivot Solution
00
06
-1 -4 0 1 20
121
540
Step 6: Convert the pivot to 1 if needed (in this case, pivot
divided by two and so does for the whole row)
Solution
-1 -4 0 0 0
0.5 1 0.5 0 3
5 4 01 20
Step 7: Change the remaining column pivot to zero
1 = 1 + 4 2 so does for the whole ROW 1
3 = 3 − 4 2 so does for the whole ROW 3
Solution
1 0 20 12
0.5 1 0.5 0 3
3 0 -2 1 8
Step 8: Continue steps (3-7) until there is no negative
value in the index row for the maximum objective
function. Since this tableau already contains non negative
values for the index row, so it is already the final tableau.
Step 9: Therefore, the answer for linear programming is
= , = , =
(Piyush N. Shah, Anesh P. Shah, & P Shah Varsha, 2003)
LINEAR PROGRAMMING
A Step By Step Handbook
40
Example 2 Solve the equations below by using the Simplex Method.
Maximise = 3 + 4
Subject to ≤ 2
y≤4
− + 2 ≤ 6
Step 1 : Convert to standard form Solution
− 3 − 4 = 0 00
+ 1 = 2 02
y + 2 = 4 04
− + 2 − 3 + 3 = 6 16
Step 2: Construct the initial tableau
-3 -4 0 0 0
10100
01010
-1 2 0 0 -1
Step 3: Choose the column (entering variable)
Solution
-3 -4 0 0 0 0 0
101000 2
010100 4
-1 2 0 0 -1 1 6
LINEAR PROGRAMMING
A Step By Step Handbook
41
Step 4: Choose the row (leaving variable)
=
Solution Ratio
-3 -4 0 0 0 0 0 -
-
101000 2 4
3
010100 4
-1 2 0 0 -1 1 6
Step 5: Choose the pivot
Solution
-3 -4 0 000 0
101 000 2
010 100 4
-1 2 0 0 -1 1 6
Step 6: Convert the pivot to 1 if needed (in this case,
pivot divided by two and so does for the whole row)
Solution
-3 -4 0 0 0 0 0
101000 2
010100 4
-0.5 1 0 0 -0.5 1 3
LINEAR PROGRAMMING
A Step By Step Handbook
42
Step 7: Change the remaining column pivot to zero
1 = 1 + 4 4 so does for the whole ROW 1
2 = does not need to do because already 0
3 = 3 − 4 so does for the whole ROW 3
Solution
-5 0 0 0 -2 2 12
101000 2
0.5 0 0 1 0.5 -0.5 1
-0.5 1 0 0 0.5 1 3
Step 8: Continue steps (3-7) until there is no negative
value in the index row for the maximum objective
function. Since this tableau already contains non negative
values for the index row, so it is already the final tableau.
Solution
-5 0 0 0 -2 2 12
101000 2
0.5 0 0 1 0.5 -0.5 1
-0.5 1 0 0 0.5 1 3
Solution
0 0 0 10 3 -3 22
0 0 1 -2 -1 1 0
1 0 0 2 1 -1 2
0 1 0 1 0 0 4
Step 9: Therefore, the answer for linear programming is
= , = , =
LINEAR PROGRAMMING
A Step By Step Handbook
43
Example 3 A shop sells two types of handbags A and B. The shop can
sell bags A and bags B per day. The time taken to do
the final touch-up is 4 hours for bag A and 4 hours for bag
B. The sale of the bags per day is subject to the following
constraints:
i. The number of bags A is not more than 50.
ii. The number of bags B is not more than twice the
number of bag A by at most 20 bags.
iii. The total time taken to do the final touch-up should
not be more than 20 hours
Find the maximum profit if the profits from the sale of bag
A and bag B are RM25 and RM20, respectively. Solve the
questions by using the Simplex Method.
Define the variables and state the objective function and
linear inequalities (constraints)
= the number of bags A
= the number of bags B
= the profit gain
Objective function, max = 25 + 20
Constraints
+ ≤ 50
≤ 2 + 20
4 + 4 ≤ 20
≥ 0
≥ 0
LINEAR PROGRAMMING
A Step By Step Handbook
44
Step 1 : Convert to standard form
− 25 − 20 = 0
+ y + 1 = 50
−2x + y + 2 = 20
4 + 4 + 3 = 20
Step 2: Construct the initial tableau
Solution
-25 -20 0 0 0 0
111 0 0 50
-2 1 0 1 0 20
440 0 1 20
Step 3: Choose the column (entering variable)
Solution
-25 -20 0 0 0 0
1110 0 50
-2 1 0 1 0 20
4400 1 20
Step 4: Choose the row (leaving variable)
=
Solution Ratio
-25 -20 0 0 0 0 -
50
11100 50 -
5
-2 1 0 1 0 20
44001 20
LINEAR PROGRAMMING
A Step By Step Handbook
45
Step 5: Choose the pivot
Solution
-25 -20 0 0 0 0
1110 0 50
-2 1 0 1 0 20
4400 1 20
Step 6: Convert the pivot to 1 if needed (in this case, pivot
divided by two and so does for the whole row)
Solution
-25 -20 0 0 0 0
1110 0 50
-2 1 0 1 0 20
1 1 0 0 0.25 5
Step 7: Change the remaining column pivot to zero.
1 = 1 + 25 4 so does for the whole ROW 1 Solution
2 = 2 − 4 so does for the whole ROW 2
3 = 3 + 2 4 so does for the whole ROW 3
0 5 0 0 6.25 125
0 0 1 0 -0.25 45
0 3 0 1 0.5 30
1 1 0 0 0.25 5
Step 8: Continue steps (3-7) until there is no negative
value in the index row for the maximum objective
function. Since this tableau already contains non negative
values for the index row, so it is already the final tableau.
Step 9: Therefore, the answer for linear programming is
= , = , =
LINEAR PROGRAMMING
A Step By Step Handbook
46
Example 4 A breeder has 10 workers to take care of cow and goat. He
has to plan to use at least 7 workers. However, he has only
RM1200 to spend and a cow costs RM200 to take care and
a goat costs RM100. Moreover, the breeder has to get the
take care done in 12 hours and it takes an hour to take care
of a cow and 2 hours to take care of a goat. If the profit is
RM500 per cow and RM300 per goat, how many of each
cow and goat should be taken care to maximise profits?
Solve the questions by using the Simplex Method.
Define the variables and state the objective function and
linear inequalities (constraints)
= the number of cows
= the number of goats
= the profit gain
Objective function, max = 500 + 300
Constraints ≥7
≤ 1200
+ ≤ 12
200 + 100
+ 2
≥ 0
≥ 0
Step 1 : Convert to standard form
− 500 − 300 = 0
+ y − 1 + 1 =7
200 + 100y + 2 = 1200
+ 2 + 3 = 12
LINEAR PROGRAMMING
A Step By Step Handbook