Introduction To Linear Programming
Introduction To Linear Programming
INTRODUCTION
These are mathematical technique that deals with optimism of linear function
variables known as objective functions. It is a method of determine an
optimum program of independent activities in view of available resources.
Linear programming is a technique of decision making used by managers to
allocate limited resources e.g. machinery, raw materials and labor in order to
minimize costs or maximize production. Decision variable are the amounts of
each product to be made in a given time period. Linear programming assumes
that the variable has a linear relationship.
Advantages
1. It helps in retaining the optimum use of production factor e.g.
efficient use of man power.
2. it improves quality of decision
3. it gives possible practice positively
4. It improves the knowledge and skills of executive.
Limitation
1. it assumes that the activity is infinitely divisible
2. it treats all relationships as linear
3. it takes into account single object only.
4. It can be adopted only under the condition of certainty i.e. when the
quantity of resources is known.
NOTE: If only two variables are involved, a graphical solution can be used
otherwise for multivariable problems, an algebraic method is applied to find
the solution.
Example 1:
Long Castling Breweries manufactures two brands of beer, Benko lager and
Benoni lager. Benko has a contribution of Sh.4 per unit and Benoni has a
contribution of Sh.3 per unit. Benko requires 30 machine minutes and 30 labor
minutes to manufacture a unit. Total available machine hours per day are 12hrs
whereas total available labor hours per day are 14hrs.
Required:
1. Formulate linear programming model.
2. How much of each brand should Long Castling produce if it wishes to
maximize its daily contribution assuming that all the lager produced is sold.
314
Solution:
1. Formulating a linear programming model
PRODUCT Maximum
available
(PER DAY) X1 X2 hours/day
Machine hours 0.5 0.33 12
Labor hours 0.5 0.5 14
Contribution 4 3
For Long castling breweries we have limited machine hours (12hrs/day), which
must be shared among production of Benko and Benoni lagers.
Therefore production must be such that the numbers of machine hours required
is less than or equal to 12 hours per day.
0.5X1+0.33X2 ≤ 12hrs
315
Thus the complete linear programming model is;
Maximize 4X1 + 3X2
Graphical solution
This method is used to solve LP models in case where only two variables are
involved. For more than two variables (multivariable) then the simplex
technique (algebraic method may be used).
Now in solving the problem above we first draw the axis, taking X 1 to be the y
axis and X2 to be the X axis.
X1
0
X2
Next we plot the scales on each axis to approximate the scales to use them, we
consider each constraint equation. We get the value of one of variables putting
the other variable to be zero and by substituting the inequality ≤or ≥ with
equality sign (=).
When X2 = 0
0.5X1 + 0.5(0) = 14
0.5X1 = 14
X1 = 14/0.5 = 28
Therefore the point is (0, 28)
317
Now including the Non-Negativity constraints since no negative product can be
produced;
X1 ≥ 0; x2 ≥ 0
We must now consider how to choose the production which will maximize
contribution. This we do by plotting a line representing the objective function
(4x1 + 3x2).
318
First choose a convenient point inside the feasible region
All of the other product mixes that give a contribution of Sh.100 lies on the
line:
Plotting these two contribution lines to our graph we get two parallel lines.
Until we reach the last feasible solution(s) before the line moves entirely out of
the feasible region.
319
Point X is the last feasible solution. Coordinates of this point give a
combination of the two lager’s production volumes that fetches the highest
contribution.
Coordinates of point X can be read from the graph, but for precision they are
calculated by solving simultaneously the equations of the two lines that
intersect at point X.
The two constraints are called binding or limiting constraints. They are the
resources being fully used thus preventing daily contribution from increasing
further.
Therefore to get point x we solve:
Therefore 11.76 units of Benko lager and 16.24 units of Benoni lager need to be
produced for maximum contribution.
320
Requirements in linear programming
Assumptions that are made to solve these types of problems are that:.
• Proportionality: all activities in linear programming problems are
proportional to the level of decision variables.
• Divisibility: the solution to a linear programming problem does not have
to be an integer but for strictly whole number solutions, use integer
programming.
• Non-negativity: no decision variable can be negative.
• Additivity: the total of all activities in linear programming problems are
assumed to equal to the sum of individual activities.
Minimizing problem
Example
A manufacturing company has acquired new machine for producing product P
at a rate of 25 units per hour with a 98% rate of efficiency. The company
requires producing at least 1800 units of P per day. The 10 old machines that
the company has produce 15 units of P with 95% efficiency.
The cost of operating the new machine is Sh. 4 per hour and Sh. 3 per hour for
the old ones. The cost incurred due to inefficiency is Sh. 2 per unit; It is
government policy that at least 2 of the new machines must be indulged into
production.
The company wishes to optimally allocate the machines in order to minimize
the total manufacturing cost if the total available hours for production in a day
are 8 hours.
Solution
In minimizing problems we use ≥ (greater or equal to) type inequality.
X2
8
X1
322
The line X1 ≥2 does not affect the feasible region (doesn’t cause reduction of
the feasible region), this constraint doesn’t limit attainment of the objective,
thus its known as a redundant constraint.
Now picking a convenient point inside the feasible region, say (6, 10)
Moving this line parallel toward the origin to locate the last apex before the
line completely fall off the feasible region, we get:
Maximize 4X1 + 3 X2
323
Subject to: 0.5X1 + 0.33X2 ≤ 12 (Machine hours)
0.5X1 + 0.5X2 ≤ 14 (labor hours)
Starting with machine hours; let’s assume that one more machine hour is
available (with labor hours remaining constant)
We get:
0.5X1 + 0.33X2 = 13
0.5X1 + 0.5X2 = 14
Solving this simultaneously we get the values of X1 and X2 as
0.17 X2 = 1
X2 = 5.88
X1 = 22.12
Thus the contribution is
4(22.12) + 3(5.88) = Sh.106.12
Comparing this with its original contribution of Sh.100.24 (see example 1) we
see increasing machine hours by one unit has increased contribution by
Sh.5.88, which is the shadow price per machine hour.
Note: This figure is also arrived at if we assume that machine hours are
reduced by 1 unit i.e. 12-1.
Similarly assuming that one more labor hour is made available, and then
contribution change is:
0.5X1 + 0.33X2 = 12
0.5X1 + 0.5X2 = 15
Solving this simultaneously gives:
0.17 X2 =3
X2 = 17.65
X1 = 12.35
Which give a contribution of.
4(12.35) + 3(17.65) = Sh.102.35
The contribution change is Sh.2.11 which is the shadow price per labor hour.
Note:
The shadow prices apply in so far as the constraint is binding for example if
more and more labor hours are available it will reach a point where labor hours
are no longer scarce thus labor hours cease to be a binding constraint and its
shadow price becomes a zero.(All non-binding constraints have zero shadow
price). Logically its senseless to pay more to increase a resource, which is
already abundant.
Sensitivity Analysis
324
Definition: Sensitivity analysis is the test of how certain changes in resources
affect the optimal solution.
SIMPLEX METHOD
When analyzing linear programming problems with three or more variables the
graphical method becomes enadequate, in such cases we employ simplex
method . Simplex method is an algebraic procedure for solving systems of
equations requiring optimization of the objective function..
This method can be applied to any number of variables, the more they are the
more complex it becomes to workout a solution on paper. Computer programs
e.g. Tora are used to solve the most intricate problems.
The first step in simplex method is conversion of inequalities to linear
equations
Example
Consider the linear problem.
Maximize 45 x1 + 80 x2
Subject to 5 x1 + 20 x2 400
10 x1 + 15 x2 450
x1 0, x2 0
Solution.
1. To convert this problem to a system of linear equation, we introduce
slack variables to each constraint.
Z = 45 x1 + 80 x2
Subject to 5 x1 + 20 x2 + x3 = 400
10 x1 + 15 x2 + x4 = 450
x1 , x2 , x3 , x4 0
325
e y
x3 5 20 1 0 400
x4 10 15 0 1 450
Z 45 80 0 0 0
3. Select the column with the highest value of Z (i.e. 80), then devide the
positive numbers in that column (i.e. the x 2 column) into the quantity
column.
i.e. 400 20 = 20
450 15 = 30
Chose the row giving the lowest result (in our case the row with x 3 gives 20)
and mark the element falling on the intersection of the selected row and
selected column (i.e. 20: selected element)
4. Divide all the elements in the selected row by the value of the selected
and change the solution variable to the heading of the identified column
(from x3 to x2)
Thus the tableau will appear as follows.
Solutio Products Slack Solutio
n Variables n
Variabl x1 x2 x3 x4 Quantit
e y
x2 1
4
1 1
20
0 20
x4 10 15 0 1 450
Z 45 80 0 0 0
Therefore:
Row 2 – 15×Row 1
326
x4 10 15 0 1 = 450
−
15 x2 15
4 15 15
20 0 = 300
new x4 6 14 0* 34 1 = 150
Note that the aim was to attain the zero.
Z 45 80 0 0 = 0
−
80 x2 20 80 4 0 = 1600
new Z 25 0* −4 0 = −1600
Since in the Z row under products column we still have values greater than
zero, we conduct another operation.
Taking the column with a Z value of 25, we repeat the process in the same
manner.
20 14 = 80
150 6 14 = 24
Thus we pick the x4 row and mark the element 6 14 , the row solution
variable is changed to x1 and we divide the row by 6 14 to convert the
marked element to 1.
Therefore; x1 1 0 3
25
4
25 = 24
new x
2 0* 1 1
50 − 251 = 24
Z 25 0 −4 0 = −1600
−
25 x1 25 0 3 4 = 600
new Z 0* 0 −7 − 4 = −2200
This is the final tableau since the Z row has no values greater than zero thus
we have the optimal solution.
Interpretation
• to maximize Z we need to produce 24 units x2 and 24 units of x1, we
obtain these values from the solutions quantity column
Thus, Z = 24(45) + 24(80) = 3000
Example
Maximize 25 x1 + 20 x2 + 24 x2
where : x1 = Xtragrow, x2 = Youngrow, x3 = Zupergrow
Subject to 0.3x1 + 0.2 x3 500
0.5 x2 + 0.4 x3 1000
0.2 x1 + 0.1x2 + 0.1x3 800
0.4 x2 + 0.3x3 600
x1 1500
x1 0, x2 0, x3 0
The computer generated solution for this problem is as follows;
Sensitivity Analysis
Variable Current obj Min obj coeff Max Obj Reduced
coeff Coeff cost
X1: Xtragrow 25 13.50 Infinity 0
X2: Youngrow 20 9.78 Infinity 0
X3: 24 -Infinity 31.67 7.67
Zupergrow
Constraint Current RHS Min RHS Max RHS Dual price
1(<) 500 450 975 83.33
2(<) 1000 750 Infinity 0
3(<) 800 483.3 Infinity 0
4(<) 600 0 800 50
5(>) 1500 -Infinity 1666.7 0
Required
Interpret the data generated by the computer.
Solution.
Table 1:
Objective value, is the solution to objective function (e.g. the solution to this
example is 71,436)
The four columns of table 1 are to be interpreted as follows;
• Variable: these are the variables of the model. In our example we have
x1 = Xtragrow, x2 = Young row and x3 = Zupergrow
• Value: this is value that the variables assume at optimal solution (to
optimize the objective function one needs to produce this amounts of
the variables). In our example we are required to produce 1,666.67 of x1
and 1,750 of x2 and none of x3
• Objective coefficient: these are the coefficients of the objective
function
• Objective value contribution: this is the value contributed by each
variable to the objective function (for x1=25×1,666.67), the total of this
is equal to our objective value (i.e. 41,666.67+35,000=76,666.67).
Sensitivity Analysis
This is the analysis of the effect of adjusting variables or constraint, whether
the objective solution will be affected. How much of the objective coefficient
(or the maximum available amount of a constraint) can be reduced or
increased without affecting the objective solution.
The columns of this table can be interpreted as follows;
Variable: as explained above
Current objective coefficient: this is the value of coefficients of the
objective function
Minimum objective coefficient: this is how low the coefficient can be
reduced without affecting the optimal basis. The coefficient for x1 can
be reduced from 25 to 13.50 (the prize for Xtragrow fall to as low as
$13.50 from $25) but the optimal solution will remain the same
Reduced cost: this is amount by which the coefficient of the variable has to
be adjusted with for it to become a basic variable (included to the
objective optimal solution). X1 and x2 have 0 reduced costs implying
that they already make part of the optimal solution, x3 will require to
be increased by 7.67 for it to make part of the basic variable.
330