Lect 2 Linear Programming - Graphical Method
Lect 2 Linear Programming - Graphical Method
Dr Anthony Obemeata
2023
Practical Steps in the formation of linear programming problem
The practical steps involved in the formation of linear programming problem are as follows:
Step 1→ Identify the Decision Variables of interest to the decision maker and express them
as x1, x2, x3 .........
Step 2→ Ascertain the Objective of the decision maker whether he wants to minimize or to
maximize.
Step 3→ Ascertain the cost (in case of minimization problem) or the profit (in case of
maximization problem) per unit of each of the decision variables.
Step 4→ Ascertain the constraints representing the maximum availability or minimum
commitment or equality and represent them as less than or equal to (≤) type of
inequality or greater than or equal to (≥) type inequality or 'equal to' (=) type
equality respectively.
Step 5→ Put non-negativity restriction as under: xj ≥ 0; j = 1, 2 ....n (non-negativity
restriction)
Step 6→ Now formulate the LP problem as:
Maximize (or Minimize) Z = c1x1 + c2x2 .....cnxn
Subject to constraints:
a11x1 + a12x2, ... a1nxn ≤ b1 (Maximum availability)
a21x1 + a22x2, ... a2nxn ≥ b2 (Minimum commitment)
a31x1 + a32x2, ... a3nxn = b3 (Equality)
am1x1+ amx22, ... 𝑎𝑎𝑚𝑚𝑚𝑚 𝑥𝑥𝑛𝑛 ≤≥ bm
x1, x2 ... xn ≥ 0 (Non-negativity restriction)
where,
xj = Decision Variables i.e. quantity of jth variable of interest to the decision maker.
cj = Constant representing per unit contribution (in case of Maximization Problem) or
Cost (in case of Minimization Problem) of the jth decision variable.
aij = Constant representing exchange coefficients of the jth decision variable in the ith
constant.
bi = Constant representing the ith constraint requirement or availability.
Operations Research Model: An Example
• The tickets purchasing problem. A businessperson has a 5-week commitment
traveling between Lagos (LAG) and Abuja (ABJ). Weekly departure from Lagos
occurs on Mondays for return on Wednesdays. A regular roundtrip ticket costs
₦40,000 but a 20% discount is granted if the roundtrip dates span a weekend. A
one-way ticket in either direction costs 75% of the regular price. How should the
tickets be bought for the 5-week period?
• This is a decision-making problem whose solution requires answering three
questions:
1. What are the decision alternatives?
2. Under what restrictions is the decision made?
3. What is an appropriate objective criterion for evaluating the alternatives?
The Tickets Purchasing Problem
• Three plausible alternatives come to mind:
1. Buy five regular LAG-ABJ-LAG for departure on Monday and return on
Wednesday of the same week.
2. Buy one LAG-ABJ, four ABJ-LAG-ABJ that span weekends, and one ABJ-LAG.
3. Buy one LAG-ABJ-LAG to cover Monday of the first week and Wednesday of the
last week and four ABJ-LAG-ABJ to cover the remaining legs. All tickets in this
alternative span at least one weekend.
• The restriction on these options is that the businessperson should be able to leave
LAG on Monday and return on Wednesday of the same week.
• An obvious objective criterion for evaluating the proposed alternatives is the price of
the tickets. The alternative that yields the smallest cost is the best.
The Tickets Purchasing Problem
Specifically, we have:
Alternative 1 cost = 5 × ₦40,000 = ₦200,000
(5 LAG-ABJ-LAG tickets)
Alternative 2 cost = 0.75 × ₦40,000 + 4 × (0.8 × ₦40,000) + 0.75 × ₦40,000 = ₦188,000
(1 LAG-ABJ, 4 ABJ-LAG-ABJ and 1 ABJ-LAG tickets)
Alternative 3 cost = 5 × (0.8 × ₦40,000) = ₦160,000
(1 LAG-ABJ-LAG and 4 ABJ-LAG-ABJ)
• Alternative 3 is the cheapest.
Note that the three main components of an OR model—alternatives, objective criterion,
and constraints are involved in this example.
It follows therefore that the general OR model can be organized in the following general
format:
Maximize or Minimize Objective Function
Subject to:
Constraints
The Meaning of Some Key Terms Used in OR
• A solution is said to be feasible if it satisfies all the constraints.
• It is optimal if, in addition to being feasible, it yields the best (maximum or mini-
mum) value of the objective function. In the ticket purchasing problem, the problem
considers three feasible alternatives, with the third alternative being optimal.
• Note that though OR models are designed to optimize a specific objective criterion
subject to a set of constraints, the quality of the resulting solution depends on the degree
of completeness of the model in representing the real system. Take, for example, the
ticket purchasing model. If all the dominant alternatives for purchasing the tickets are
not identified, then the resulting solution is optimum only relative to the alternatives
represented in the model.
• If for some reason alternative 3 is left out of the model, the resulting “optimum” solution
would call for purchasing the tickets for ₦188,000, which is a suboptimal solution.
• The conclusion is that “the” optimum solution of a model is best only for that model. If
the model happens to represent the real system reasonably well, then its solution is
optimum also for the real situation.
Solving Operations Research Model
• In practice, OR does not offer a single general technique for solving all mathematical
models. Instead, the type and complexity of the mathematical model dictate the nature of
the solution method. For example, the solution of the tickets purchasing problem requires
simple ranking of alternatives based on the total purchasing price.
• The most prominent OR technique is linear programming. It is designed for models
with linear objective and constraint functions. Other techniques include integer
programming (in which the variables assume integer values), dynamic programming
(in which the original model can be decomposed into smaller more manageable
subproblems), network programming (in which the problem can be modeled as a
network), and nonlinear programming (in which functions of the model are nonlinear).
• These are only a few among many available OR tools.
Solving Operations Research Model
• A peculiarity of most OR techniques is that solutions are not generally obtained in
(formula-like) closed forms. Instead, they are determined by algorithms. An
algorithm provides fixed computational rules that are applied repetitively to
the problem, with each repetition (called iteration) attempting to move the
solution closer to the optimum.
• Because the computations in each iteration are typically tedious and voluminous, it
is imperative in practice to use the computer to carry out these algorithms.
• Some mathematical models may be so complex that it becomes impossible to solve
them by any of the available optimization algorithms. In such cases, it may be
necessary to abandon the search for the optimal solution and simply seek a good
solution using heuristics or metaheuristics, a collection of intelligent search rules of
thumb that move the solution point advantageously toward the optimum.
Solving LP Problem Using Graphical Solution:
Example 1
A toy manufacturer produces dolls & guns for which he requires
material & labour. The Constraints are as follows:
1. He cannot produce more than 6 dolls & 5 guns per day.
2. He must use a minimum of 3hrs of labour per day.
3. Raw materials available are at most 60 units per day.
4. 2 Hours of labour is required for each doll & each gun.
5. Raw material required for each doll & gun are 7 & 9 respectively and Profit
per doll is ₦130 & per gun is ₦60.
Formulate the problem as a linear programming model in order to
determine the number of units of each product, which will maximize
the profit.
Solving LP Problem Using Graphical Method
The following Table provides the basic data of the problem
Toys
Dolls (x) Guns (y) Available
Raw Materials required 7 9 60
Labour 2 2 3 hrs
Max Products per day 6 5
Profit (₦) 130 60
The Toy Manufacturing LP Model :
• Decisions variables:
x = Daily production level of toy dolls (in dozens)
y = Daily production level of toy guns (in dozens).
• Objective Function:
Maximize Z = 130x + 60y (Daily profit)
• subject to
7x + 9y ≤ 60 (Plastic) (1)
2x + 2y ≥ 3 (Production Time in hours) (2)
x ≤ 6 (Maximum toy dolls per day) (3)
y ≤ 5 (Maximum toy guns per day) (4)
x, y ≥ 0 (Nonnegativity)
Solving LP Problem Using Graphical Method
Step 2: Find the 2 co-ordinates from all equations to plot lines on the graph chart
using assumptions. For example:
For eq(1) 7x + 9y ≤ 60
If we assume x=0, If we assume y=0,
Then 7(0) + 9y = 60 Then 7x + 9(0) = 60
0 + 9y = 60; 7x + 0 = 60;
y = 60⁄9 = 20⁄3 ; x = 60⁄7
2 4
y= 6 = 6.67; x= 8 = 8.57
3 7
2 4
co-ordinates (x,y) = (0, 6 ) co-ordinates (x,y) = (8 , 0)
3 7
Solving LP Problem Using Graphical Method
• For eq(2) 2x + 2y ≥ 3
If we let x = 0; If we then let y = 0;
Then 2(0) + 2y = 3 Then 2x + 2(0) = 3
0 + 2y = 3; 2x + 0 = 3;
1 1
y = 3⁄2 = 1 ; x = 3⁄2 = 1
2 2
y = 1.5; x = 1.5
1 1
co-ordinates (x,y) = (0, 1 ) co-ordinates (x, y) = (1 , 0)
2 2
• For eq(3) x ≤ 6 For eq(4) y ≤ 5
Assuming y=0, x=6 Assuming x=0, y=5
∴ Coord (x,y) = (6,0) ∴ Coord (x,y) = (0,5)
Solving LP Problem Using Graphical Method
To obtain the point D, we solve for
the two intersecting eqns:
7x + 9y = 60 … (1)
y = 5 … (2)
From eq (2), y=5
Substituting for y in eq (1)
7x + 9(5) = 60
7x = 60 – 45 = 15
15
∴ x = and y = 5. (x, y)=(15/7, 5)
7
We obtain point E thus,
7x + 9y = 60 … (1)
x = 6 … (2)
Substituting eq (2) in eq (1)
7(6) + 9y = 60
9y = 60 – 42 = 18
18
y = = 2 and x = 6. (x, y) = (6, 2)
9
Extreme Coordinates Max. Z = 130x + 60y Profit
Point
A (3⁄2, 0) Z=130(3⁄2) + 60(0) ₦195.00
B (0, 3⁄2) Z=130(0) + 60(3⁄2) ₦90.00
C (0, 5) Z=130(0) + 60(5) ₦300.00
D (15/7, 5) Z=130(15/7) + 60(5) ₦578.57
E (6, 2) Z=130(6) + 60(2) ₦900.00
F (6, 0) Z=130(6) + 60(0) ₦780.00
Let x be the number of programmes of T.V. advertising and y denote the number of
programmes of radio advertising.
Since the advertising firm desires to determine the media mix to maximize the total
reach, the objective function is given by:
Maximize Z = (750,000+150,000)x + (40,000+260,000)y
= 900,000x + 300,000y or
Subject to the constraints:
50000x + 20000y ≤ 200000 [Maximum advertising budget] (1)
x ≥ 3, [Minimum number of T.V. programmes] (2)
y ≤ 5 [Maximum number of Radio programmes] (3)
x, y ≥ 0
Solving LP Problem Using Graphical Method
Step 2: Find the 2 co-ordinates from all equations to plot lines on the
graph chart using assumptions.
For eq(1) 50000x + 20000y ≤ 200000
If we assume x=0, If we assume y=0,
50000(0) + 20000y = 200000 Then 50000x + 20000(0) = 200000
0 + 20000y = 200000; 50000x + 0 = 200000;
y = 200000⁄20000 ; x = 200000⁄50000
y = 10; x=4
co-ordinates (x,y) = (0, 10) co-ordinates (x,y) = (4,0)
For eq(2) x ≥ 3
With y=0, x = 3
∴ Coord (x,y) = (3,0)
For eq(3) y ≤ 5
With x=0, y = 5
∴Coord (x,y) = (0,5)
Bringing everything together,
we obtain this graph.
To obtain the point B in the graph, we
solve for the two intersecting eqns:
50 000x + 20 000y = 200 000 … (1)
x = 3 … (2)
From eq (2), x=3
Substituting for x in eq (1)
50 000(3) + 20 000y = 200 000
20 000y = 200 000 – 150 000 = 50 000
50000 5
y= =
20000 2
5
∴ (x, y) =(3, )
2
To determine the media mix that maximize the total reach, we calculate the possible
profit for each of the extreme points - A, B, C :
• It can be seen that the value of Z is maximum at point C (4, 0). Thus, the solution to
the given problem is: x = 4, y = 0 and Maximum Z = 36,000,000.
• In other words, the advertising firm should give 4 programmes on TV and no
programme on Radio in order to achieve a maximum reach of 36,000,000 customers.
• Note too that all the constraints are satisfied.