Linear Programming Examples A Maximization Model Example
Linear Programming Examples A Maximization Model Example
Examples
Image Pottery Company is a small crafts operation run by Native Nepali tribal council. The
company employs skilled artisans to produce clay bowls and mugs with authentic Native Nepali
designs and colors. The two primary resources used by the company are special pottery clay and
skilled labor. Given these limited resources, the company desires to know how many bowls and
mugs to produce each day in order to maximize profit. This is generally referred to as a product
mix problem type. The two products have the following resource requirements for production
and profit per item produced (i.e., the model parameters):
There are 40 hours of labor and 120 kg of clay available each day for production. We will
formulate this problem as a linear programming model by defining each component of the model
separately and then combining the components into a single model. The steps in this formulation
process:
Decision Variables
Model Constraints
Non negativity
x1 ≥ 0, x2 ≥0
To complete linear programming model for this problem can now be summarized as follows
Subject to
x1 + 2x2 ≤ 40
x1 ≥ 0, x2 ≥0
Graphical Solution of Example 1: Recall that the problem describes Image Pottery Company’s
attempt to decide how many bowls and mugs to produce daily, given limited amounts of labor
and clay. The complete linear programming model was formulated as:
Subject to
x1 ≥ 0, x2 ≥0
The first step in drawing the graph is to plot the constraints on the graph . This is done by
treating both constraints as equations (or straight line or taking equality sigh only) and plotting
each line on graph.
x1 + 2x2 ≤ 40
x1 + 2x2 = 40
A simple procedure for plotting this line is to determine two points that are on the line and then
draw a straight line through the points. One point can be found by letting x 1 = 0 and solving for
x2
(1) + 2x2 = 40
x2 = 20
Thus, one point is at the coordinate x1 = 0 and x2 = 20. A second point can be found by letting
x2= 0 and solving for x1
x1 + 2(0) = 40
x1 = 40
The line on the graph representing this equation is drawn by connecting these two points as
shown in graph. However, this is only the graph of the constraint line (1) and does not reflect the
entire constraint, which also includes the values less than or equal to (≤) this line.
To identify the area (feasible region) of constraint (1), taking (0, 0) as a testing point [putting x 1
= 0 and x2 = 0 in constraint (1)]
0 + 2 (0) ≤ 40
0 ≤ 40 (true)
i.e. the feasible region lies on the same side of the testing point (i.e. 0,0 origin). [i.e. arrow goes
towards the trial point].
[Note that it is not always necessary of taking (0,0) as a testing point, we can take any points
except those points which do not lie on the line and for the constraint having zero RHS we
should not take (0,0) as a testing point because the constraint having zero RHS always pass
through the (0,0) ]
0 ≤ 120
The feasible area of this constraint lies on the same side of the testing point [i.e. the arrow goes
towards the testing point]
For the non negativity constraints (graphical axis) x1 ≥ 0, x2 ≥ 0; only the positive quadrant is
taking as shown in graph (i.e., the quadrant x1 and x2 will always be positive).
X2
Graph
45
40
35
30
(2)
25
A(0, 20)
20
15
10 B(24, 8)
5
C(30, 0) (1)
X1
0
5 10 15 20 25 30 35 40 45
The shaded area in graph is the area that is common to both model constraints. Therefore, this is
the only area on the graph that contains points (i.e. values for x 1 and x2) that will satisfy both
constraints simultaneously. This shaded area in graph is referred as the feasible solution area
because all the points in this area satisfy both constraints. Some point within this feasible
solution area will result in maximum profit for Image Pottery Company.
The solution point will be on the boundary of the feasible solution area and at one of the corners
of the boundary where two constraint lines intersect. These corner points (point A, B, C and O in
graph) are called extreme points.
It has been proven mathematically that the optimal solution in a linear programming model will
always occur at an extreme point.
Therefore, in this problem the possible solution points are limited to the four extreme points A,
B, C and O. The optimal extreme point is the extreme point which gives the maximum value
(minimum value for minimization problem).
Now from graph, the extreme (corner) points and their respective objective function values are
A (0,20) 1000
B (24, 8) 1360 (Max)
C (30, 0) 1200
O (0,0) 0
Here, extreme value B (24, 8) gives maximum value. Hence optimal solution (OS) is (24, 8) and
optimal value is 1360.
In terms of original problem, the solution indicates that of the pottery company produces 24
bowls and 8 mugs, it will receive Rs. 1360, maximum daily profit possible (given the resource
constraints).
A farmer is preparing to plant a crop in the spring and needs to fertilize a field. There are two
brands of fertilizer to choose from, Super-gro and Crop-quick. Each brand yields a specific
amount of nitrogen and phosphate per bag as follows:
Solution
Decision Variables
This problem contains two decision variables, representing the number of bags of each brand of
fertilizer to purchase:
x1 = bags of Super-gro
Minimize Z = 60 x1 + 30 x2
Model Constraints
2 x1 + 4 x2 ≥ 16 kg
4 x1 + 3 x2 ≥ 24 kg
Non negativity
Here non negativity indicates that negative bags of fertilizer can not be purchased
x1≥0 x2 ≥0
Minimize Z = 60 x1 + 30 x2
Subject to
2 x1 + 4 x2 ≥ 16
4 x1 + 3 x2 ≥ 24
x1≥0 x2 ≥0
We follow the same basic steps in the graphical solution of a minimization model as in a
maximization model. Graphical solution of fertilizer example:
Minimize Z = 60 x1 + 30 x2
Subject to
2 x1 + 4 x2 ≥ 16 ……………….. (1)
4 x1 + 3 x2 ≥ 24 ………………. (2)
x1 ≥0 x2 ≥0
2 x1 + 4 x2 ≥ 16
2 x1 + 4 x2 = 16
When x1 = 0 x2 = 4 i.e. (0, 4)
Joining these two points (0, 4) and (8, 0) in the graph gives the constraint line (1).
2 (0) + 4 (0) ≥ 16
0 ≥ 16 (False)
Hence, the feasible region lies on the opposite side of the testing point (i.e. the arrow goes
towards the opposite of the testing point).
4 x1 + 3 x2 ≥ 24
4 x1 + 3 x2 = 24
Joining these two points (0, 8) and (6, 0) in the graph gives the constraint line (2).
4 (0) + 3 (0) ≥ 24
0 ≥ 24 (False)
Hence, the feasible region lies on the opposite side of the testing point (i.e. the arrow goes
towards the opposite side of the testing point).
For the non negativity constraints (graphical axis) x1 ≥ 0, x2 ≥0; only the positive quadrant is
drawn as shown in graph (i.e., the quadrant x1 and x2 will always be positive).
Graph
X2
9
A(0, 8)
8
2 B(4.8, 1.6)
1
C(8, 0)
0 X1
1 2 3 4 5 6 7 8 9
Here extreme point (0, 8) gives lowest value i.e. 240 hence optimal solution (OS) is (0, 8) and
Optimal value (OV) is Rs 240.
This means that the farmer should not purchase any Super- gro but, instead, should purchase 8
bags of Crop-quick, at a total cost of Rs 240.
Example 3: A carpenter has 90, 80 and 50 meters of teak, plywood and rosewood. The product
A requires 2, 1 and 1 unit and product B requires 1, 2 and 1 units of teak, plywood and
rosewood, resp. If product A and B have profits of Rs. 48 and Rs. 40 per unit respectively, then
how much of each product should be produced to make maximum profit. [PU 2007 spring]
i. Give a mathematical model to this LP problem
Solution:
Since the profit of each product is given so that the objective of the given problem is
maximization of total profit
Subject to
2x1 + x2 ≤ 90 ……………..(1)
x1 + 2x2 ≤ 80 …………….(2)
x1 + x2 ≤ 50 …………….(3)
Non negativity
x1 ≥0, x2≥0
Graphical Solution
2x1 + x2 ≤ 90
Joining these two points (0, 90) and (45, 0) in the graph gives the constraint line (1).
2 (0) +(0) ≤ 90
0 ≤ 90 (true)
Hence, the feasible region lies on the same side of the testing point (i.e. the arrow goes towards
the testing point).
x1 + 2x2 ≤ 80
x1 + 2x2 = 80
Joining these two points (0, 40) and (80, 0) in graph gives the constraint line (2).
(0) + 2 (0) ≤ 80
0 ≤ 80 (true)
Hence, the feasible region lies on the same side of the testing point (i.e. the arrow goes towards
the testing point).
x1 + x2 ≤ 50
x1 + x2 ≤ 50
Joining these two points (0, 50) and (50, 0) in graph gives the constraint line (3).
(0) + (0) ≤ 50
0 ≤ 50 (true)
Hence, the feasible region lies on the same side of the testing point (i.e. the arrow goes towards
the testing point).
x2
Graph:
100
90
80
70
60
50
A(0, 40)
40
B(20, 30)
30
20
10 C(40, 10)
(45, 0)D x1
0
10 20 30 40 50 60 70 80 90 100
Here extreme point (40, 10) gives maximum value i.e. 2320 hence optimal solution (OS) is (40,
10) and Optimal value (OV) is Rs 2320
Example ATV Company produces two types of TV sets, the Astro and the Cosmo. There are
two production lines, one for each set, and there are two departments, both of which are used in
the production of each set. The capacity of the Astro production line is 70 sets per day. The
capacity of the Cosmo line is 50 sets per day. In department A picture tubes are produced. In this
department the Astro set requires 5 labor hours and the Cosmo set requires 4 labor hours.
Presently in department A a maximum of 120 labor hours and the hours. per can be assigned to
production of the two types of sets. In department B the chassis is constructed. In this department
the Astro set requires 4 labor hours and the Cosmo also requires 2 labor hours. Presently, in
department B a maximum of 90 labor hours per day can be assigned to production of the two
types of sets. The profit contributions are 20 and 10 rupees, respectively, for each Astro and
Cosmo set.
i. Formulate this LP problem.
ii. Solve this LP problem graphically.
Solution:
Objective function
Subject to
x1 ≤ 70……………………..(1)
x2 ≤ 50……………………..(2)
x1+2x2 ≤ 120………………(3)
x1+x2 ≤ 90………………….(4)
x1 ≥ 0, x2 ≥0
Solution
x1 ≤ 70
x1 = 70
and, the feasible region is left side area of vertical line x1= 70
x2 ≤ 50
x2 = 50
x1+2x2 ≤ 120
x1+2x2 = 120
Joining these two points (0, 60) and (120, 0) in graph gives the constraint line (3).
0 ≤ 120 (true)
Hence, the feasible region lies on the same side of the testing point (i.e. the arrow goes towards
the testing point).
x1+x2 ≤ 90
x1+x2 = 90
Joining these two points (0, 90) and (90, 0) in graph gives the constraint line (4).
(0) + (0) ≤ 90
0 ≤ 90 (true)
Hence, the feasible region lies on the same side of the testing point (i.e. the arrow goes towards
the testing point).
Graph: x2
100
90
(4)
80 (1)
70
60
(3)
B(10.8,50) (2)
50 A(0, 50)
40
30 C(60, 30)
20 D(70, 20)
10
E(70, 0) x1
0
10 20 30 40 50 60 70 80 90 100 110 120
From Graph, We have
Here extreme point (70, 20) gives maximum value i.e. 1600 hence optimal solution (OS) is (70,
20) and Optimal value (OV) is Rs 1600.
If, at optimality (i.e. when evaluated at the optimal solution), the left hand side of a
constraint equals the right hand side, that constraint is said to be active, or binding.
Thus, an equality constraint is always active. An inequality constraint may or may not be
active.
Geometrically, an active constraint is one that passes through the optimal solution.
Geometrically, an inactive constraint is one that does not pass through the optimal
solution.
At optimality, each inequality constraint in a model has a slack or surplus value and for
feasible decisions this value is always nonnegative. For a given constraint the slack or
surplus value is zero if and only if that constraint is active.
For a constraint of the ≤ type, the difference between the right hand side and the left hand
side (the amount unused) is called slack. Hence slack relates to a ≤ constraint; it is the
amount of a constraint that is unused by a solution. For example, if one constraint in a
problem is that ≤ 100 hours and the solution requires the use of 90 hours of labor, then
we can say that the labor constraint has a slack of 10 hours. Thus, slack is the amount by
which the left-hand side of a ≤ constraint is less than the right-hand side of the constraint.
For a constraint of ≥ type, the difference between the left hand and the right hand side
(the excess) is called surplus. Hence surplus relates to a ≥ constraint; it is the amount by
which a constraint is exceeded by a solution. For example, if a constraint requires that the
number of units of product A that are made be ≥ 10, and a solution results in 12 units
being produced, we can say that there is a surplus of 2 units. Thus, surplus is the amount
by which the left hand side of ≥ constraint exceeds the right hand side.
Determination of slack and surplus is straightforward. First, note whether the constraint is
a ≤ or a ≥ constraint. Next, substitute the optimal values of decision variables into the left
hand side of the constraint and solve. Then, compare the resulting value to the right hand
side of the constraint. The difference between the two is the amount of slack (for a ≤
constraint) or surplus (for a ≥ constraint).
For example, suppose that we have the constraint 2x1+ 3x2 ≤ 50 and that x1 = 4 and x2 =
5. Because this is a ≤ constraint, we know that slack rather than surplus is relevant.
Substituting the values of x1 and x2 into the left hand side of constraint, we obtain
2(4) + 3 (5) = 23
This is 27 less than the right hand side value. Hence, slack = 27.
Now, suppose we have the constraint 4x1 + 2x2 ≥ 10 and x1 = 3 and x2 = 1. Because this
is a ≥ constraint, we know that surplus is involved. Substituting the values of x1 and x2
into left hand side, we obtain
4(3) + 2 (1) = 14
subject to
E +F ≥ 5
E – 3F ≤ 0
20E + 10 F ≤ 160
30E + 10 F ≥ 135
E, F ≥ 0
i) Find an optimal solution and the associated objective function of this linear program.
ii) Which constraints are active? Which are inactive?
iii) What are the slack and surplus values associated with each constraint?
iv) The feasible region has how many extreme points?
Solution
Given objective function is
Max. Z= 5000E + 4000F
And constraints are
E+F>5 ... (1)
E - 3F < 0 ... (2)
10E + 15F < 150 ... (3)
20E + 10F < 160 ... (4)
30E + 10F > 135 ... (5)
E, F > 0
For constraint (1)
E+F>5
Taking only equality sign
E+F=5
When E = 0, F = 5 i.e. (0, 5)
When F = 0, E = 5 i.e. (5, 0)
Taking origin (0, 0) as a trial point (testing point)
or 0+0>5
0 > 5 (false)
i.e. feasible region lies on the opposite side of trial point (testing point).
For constraint ( 2)
E - 3F < 0
Taking only equality sign
E - 3F = 0
When E = 0, F = 0 i.e. (0, 0)
When E = 6, F = 2 i.e. (6, 2)
[Note: This constraint has zero RHS so that it passes through the origin and we never
get next point by taking F=0. For this case it will better of selecting value of E in such a
way that having multiple of coefficient of F]
Taking (3, 5) as a trial point (testing point) [If the line passes through the origin then
we have to take the testing point except origin (0,0) and any point which touches the line]
or 3-3×5<0
or 3 - 15 < 0
– 12 < 0 (true)
i.e. feasible region lies on the same side of trial point or testing point.
For constraint ( 3)
10E + 15 F < 150
Taking only equality sign
10E + 15 F = 150
When E = 0, F = 10 i.e. (0, 10)
When F = 0, E = 15 i.e. (15, 0)
Taking origin (0, 0) as trial point (testing point)
or 10 × 0 + 15 × 0 < 150
0 < 150 (true)
i.e. feasible region lies on the same side if the trial point (testing point)
For constraint (4)
20E + 10F < 160
Taking only equality sign
20E + 10F = 160
When E = 0, F = 16 i.e. (0, 16)
When F = 0, E = 8 i.e. (8, 0)
Taking (origin) (0, 0) as trial point (testing point)
or 20 × 0 + 10 × 0 < 160
0 < 160 (true)
i.e. feasible region lies on the same side of the trial point (testing point)
For constraint (5)
30E + 10F > 135
Taking only equality sign
30E + 10F = 135
When E = 0, F = 13.5 i.e. (0, 13.5)
When F = 0 , E = 4.5 i.e. (4.5, 0)
Taking origin (0, 0) as trial point testing points
or 30 × 0 + 10 × 0 > 135
0 > 135 (false)
i.e. feasible region lies on the opposite side of the trial (testing point)
Graph: F
17
16
15
14
13
12
(4)
11
10
9 A(1.5, 9)
8
B(4.5, 7)
7
6
(5)
5
4 (2)
(1)
3
2 C(6.8, 2.3)
D(4, 1.8) (3)
1
E
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
From graph