Operations Research
Operations Research
LINEAR PROGRAMMING
February 8, 2023
0.1 DEFINITION
Linear programming is a mathematical technique concerned with the allocation of
scarce resources. It is a procedure to optimize the value of some objective( Profit or
Cost ) when the factors invloved( Labour or material ) are subjected to some limitations
or constraints.
Maximize ( or Minimize )
n
X
cj ∗ xj
j =1
Subject to
m X
X n
a i j ∗ x j {≤, =, ≥}b i
i =1 j =1
Where:
• The i t h row may be an equation "=" , or an inequality " ≤ or ≥ "
• c j are known as Cost Coefficients
1
0.1.4 DECISION VARIABLES ( X j )
In every organization, the management must decide on the quantity of a certain produc-
tion material to be purchased in order to minimize the cost of production or the quantity
of a certain good to produce in order to maximize profit. In linear programming mod-
els, the unknown quantities are assigned mathematical symbols, which are known as
variables. Thus, the decision variables are symbols that represent the quantities of a
certain good or a production material. For example, Ghana Brewery Ltd (GBL) may
desire to produce x 1 , x 2 and x 3 quantities of ABC mini bear, ABC larger bear, and club
shandy respectively. The values of x 1 , x 2 and x 3 as determined by the management
constitute their decision. For instance, x 1 = 20, x 2 = 15 and x 3 = 25 implies that GBL
will produce 20 bottles of ABC mini bear, 15 bottles of ABC larger bear and 25 bottles
of club shandy.
The first step in linear programming is to decide what result is required (i.e. the
objective). This may be to maximize or minimize a quantity, or some other appropriate
measure. Having decided on the objective, it 1s now necessary to state mathematically,
the elements involved in achieving this. This is called the objective function.
n
X
cj ∗ xj
j =1
Subject to
m X
X n
a i j ∗ x j {≤, =, ≥}b i
i =1 j =1
2
0.2 FORMULATION OF LINEAR PROGRAMMING
MODELS
0.2.1 BASIC ASSUMPTIONS
Linear programming has a number of basic assumptions which form additional require-
ments to those mentioned above, and also enable us to formulate the linear program-
ming model correctly. Among these assumptions are:
STEP1: Read the problem carefully. If appropriate, organize the data into a table
as in the Solution to Examples 1.1 and 1.2 below.
STEP2: Determine the variables. These represent the unknown quantities who’s
values you want to find.
STEP3: formulate the objective function. This is what you want to optimize.
STEP4: Formulate the constraints. These are the expressions, which limit the
amount of resources you can use.
Example1.1:
A bicycle manufacturer owns a retail outlet and in addition sells some bikes large chain
store. One truck makes the deliveries from manufacturing ware-house to the retail out-
let and to the chain store distribution centre. It takes 2 hours to make a round trip to the
retail outlet and 4 hours to make a round trip to the distribution centre. The cost of a
round trip to the retail outlet is GHS50.00 and the cost of a round trip to the distribution
3
centre is GHS200.00.
The profit of each truckload sold through the retail outlet is GHS210.00 and the profit
GHS400.00 for the distribution centre. How many shipments per week should be
scheduled to each store in order to maximize profit if the manufacturer is limited to
no more than 40 hours of travel time per week and a cost of GHS1600:00?
SolutiontoExample1.1 :
Table 1: Caption
Example 1.2 A Farmer can chose between three feeds for his lamas. The following
table gives the nutritional requirements and costs. The minimum daily requirements of
nutrients A, B and C are 72, 81 and 69 units, respectively. Determine the mixture of
feeds that will supply the minimum nutritional requirements at least cost.
Table 2:
Solution
4
Feed A B C Cost (GHS/lb)
1 5 8 3 0.10
2 2 4 4 0.07
3 6 5 3 0.60
Minimum requirements 72 81 69
Table 3:
Subject to; 5x 1 + 2x 2 + 6x 3 ≥ 72
8x 1 + 4x 2 + 5x 3 ≥ 81
3x 1 + 4x 2 + 3x 3 ≥ 69
x i ≥ 0, for all 1 ≤ i ≤ 3
5
Method of solving linear programming problems.
The equation of a line can be written in the form ax +by = c, where: a, b, and c repre-
sent constants and x and y represent variables.
A linear inequality in two variables x and y is an expression of the form:
ax + by < c, ax +by > c, ax + by ≤ c, or ax + by ≥ c.
The graph of an inequality is the set of all points (x, y) that satisfy the inequality.
Example1.3
The graph of x + 2y ≤ 6, consist of all the points on or below the line x + 2y = 6 as
shown in figure 1 Also the graph of x + 2y ≥ 6 consist of the points on or above the
line x + 2y = 6 as shown in figure
Figure 1: .
6
0.4 SOME IMPORTANT DEFINITIONS.
1. The graph of a system of inequalities is the set of all points that simultaneously
satisfy all of the inequalities.
5. Feasible Point is any point that can be found in the feasible region.
6. Polyhedron is a region bounded by lines or more generally (hyper) planes.So
in general, the feasible region is always a polyhedron.
Also the feasible region is convex.
7. A Convex is any point on a straight line, which is joining two points within a
region, and (the point) is also in the region.
7
Figure 2: .
Example1.4
Graphically display the feasible region for the following constraints:
5x + 2y ≤ 15
2x + 3y ≤ 12
x+y≤2
x,y ≥ 0
Solution
Let 5x + 2y = 15
when x = 0, then 2y = 15
=⇒ y = 15/2
8
Also when y = 0, then 5x = 15
=⇒ x = 3.
Hence (0, 15/2) and (3, 0) are points on the boundary line 5x + 2y = 15.
Let 2x + 3y = 12
When x = 0, then 3y = 12
=⇒ y = 4
Again, let x + y = 2
Then (0, 2) and (2, 0) are the points on the boundary line x + y = 2
Figure 3: .
9
5x + 2y = 15 (1)
2x + 3y = 12 (2)
10x + 4y = 30 (3)
10x + 15y = 60 (4)
Note equations (3) and (4) were derived by multiplying equations 2*(1) and 5*(2) re-
spectively
Also, 5x + 2y = 15
5x + 2(30/11) = 15
=⇒ x = 21/11
Therefore A = (21/11, 30/11)
So, (0, 4), (0, 2). (2, 0). (3, 0), and (21/11, 30/11) are corner points of the feasible
region D. D is a polyhedron and convex.
x = 0, y = 0, 5x+2y = 15, 2x + 3y = 12, and x +y = 2 are boundary lines.
Example1.5
x+y ≤4
5x + 3y ≤ 15
x, y ≥ 0
10
Solution
Let x + y = 4
when x= 0, then y = 4
i.e.(0, 14)
Let 5x + 3y = 15
When x = 0, then 3y = 15
=⇒ y = 5 i.e. (0, 5)
Therefore the optimal solution is Z = 430 at the corner point x = 3/2 and y = 5/2
Example2.6
Minimize C= 12x + 8y
subject to:
x + y ≥ 100
2x + y ≥ 160
x + 2y ≥ 125
11
i.e. ( 100, 0)
Hence (0, 100) and (100, 0) are points on the boundary line x + y= 100.
Let 2x + y = 160
When x = 0, then y = 160
i.e. (0, 160)
Also when y = 0, then 2x = 160
=⇒ x = 80, i.e. (80, 0)
Hence (0, 160) and (80, 0) are points on the boundary line 2x + y = 160
12
Figure 4: .
13
Figure 5: .
2. Both the greater-than-or equal-to (≥) and less- than-or-equal-to (≤) constraints
can be handled without any difficulties.
3. The graphical method can deal with any number of constraints. But as the con-
straints are shown as lines on the same graph, it will be very difficult to read the
graph if the lines on the graph are many. So as the constraints increase, accuracy
decreases.
4. The Geometric Approach cannot handle (or be used to solve) problems involving
more than two decision variables.
14
For example,
6x + 2y ≤ 80
12x + 4y ≤ 160
In a more general sense, a redundant constraint does not affect the feasible solu-
tion.
Suppose, a linear programming model has the following constraint:
x 1 + x 2 ≥ 100
0.3x 1 + 0.1x 2 ≥ 15
0.1x 1 + 0.05x 2 ≥ 8
0.2x 1 + 0.4x 2 ≥ 25
the second constraint is redundant. If redundancy is detected, strike out the re-
dundant constraint and proceed as usual. Even if it is not detected, there will be
no harm done to the solution.
• UNBOUNDEDNESS There is no limit to the profit that can be made, if the feasi-
ble region of a profit maximization problem is open-ended. To solve the problem
of u:
(i) the fact that the feasible region is unbounded should be stated.
(ii) the model builder should find the constraint which was overlooked, which
would have capped off the feasible region. With this overlooked constraint
added, the analysis continues as usual, since the feasible region will no longer be
open-ended
• INCONSISTENCY suppose a linear programming model has among its con-
straints, the following:
x + y ≥ 10 and x + y ≤ 5.
it should be apparent that there cannot exist any two numbers x and y which can
satisfy the above conditions simultaneously. To solve this problem, care should
be taken to see if there are unintended constraints which could be eliminated. if
all the constraints are intended, then the model builder must decide which con-
straint to eliminate or relax.
• ALTERNATE OPTIMAL SOLUTIONS The solution is not unique, thus, the prob-
lem has more than one solution that optimizes the objective function. Thus, there
are at least two comer points that give the same optimal value. Actually, all are
optimal solutions. So, one of them should be taken and the other relaxed.
For example,
Maximize P = x 1 + x 2
15
subject to:
x 1 + 2x 2 ≤ 24
x 1 + x 2 ≤ 14
5x 1 + 3x 2 ≤ 60
x1 , x2 ≤ 0
The corner points are (0, 0), (12, 0), (9, 5). (4, 10), and (0, 12)
therefore P is given as:
at (0, 0), Z = 0 +0 = 0
at ( 12, 0), Z= 12 + 0 = 12
at (9 ,5), Z = 9 + 5 = 14
at (4, 10), Z = 4 + 10 = 14
at (0, 12), Z = 0 + 12 = 12
DEFINITIONS
(i). A system of linear equations with ’m’ equations and ’n’ variables:
a 11 x 1 + a 12 x 2 + a 13 x 3 ... + a 1n x n = b 1
a 21 x 1 + a 22 x 2 + a 23 x 3 ... + a 2n x n = b 2
a 31 x 1 + a 32 x 2 + a 33 x 3 ... + a 3n x n = b 3
.
.
.
a m1 x 1 + a m2 x 2 + a m3 x 3 ... + a mn x n = b m
Thus:
m X
X n
ai j ∗ x j = b j
i =1 j =1
16
is in canonical form (or is a canonical system of linear equations) if:
(a). m ≤ n
(b). there are "m" distinguished variables, called Basic Variables, such that each basic
variable x i has coefficient one (1) in exactly one equation and coefficients zero (0) in
the other equations and such that each equation contains exactly one basic variable.
The other variables are called non − basic variables,
For example:
x + 2y + z ≤10
becomes; x + 2y + z + s = 10
where; ’s’ is a slack variable.
(iii).SURPLUS VARIABLES:
these are variables which are subtracted from a greater-than or equal-to (≥) inequality
to take up any surplus between the right and the left hand sides of the inequality in
order to convert the inequality to equality (or equation).
For example:
x + 2y + z ≥ 10
becomes, x + 2y + z + s = 10
where, ’s’ is a surplus variables.
For example:
x + 2y +z = 10
can be written as, x + 2y + z + a = 10
where, variable ’a’ is an artificial variable.
17
Maximize
n
X
cj ∗ xj
j =1
Subject to,
m X
X n
a i j ∗ x j {≤, =, ≥}b i
i =1 j =1
(vii). ITERATION:
this is a process (or an algorithm or method) which repeat itself over and over again
until a certain stopping criterion is met (satisfied).
Where:
3. A mat r i x is the "m x n" matrix formed by the coefficients of the variables in the
constraint equation.
4. C B objective function coefficient for each of the basic variables
5. Z j is the row of the decrease in the value of the objective function that will result
if one of the Variables corresponding to the j t h column of the A mat r i x is brought
into the basis.
6. C j - Z j is the row of the net change in the value of the objective function if one
unit of the variable corresponding to the j t h column of the A mat r i x is brought
into the solution. It is called the NET EVALUATION ROW
INSERT TABLE 2.2
Table 2.2 is called the initial simplex tableau. This tableau has been filled with the
18
..
Figure 6:
19
(xi) BASIC FEASIBLE SOLUTION:
a basic solution is said to be feasible if none of the constraints are violated (especially
the non - negativity requirement of the constraints)
20
0.5 OPTIMIZING THE BASIC FEASIBLE SOLUTION
This is the process by which a basic feasible solution which in not optimal is made to
become optimal solution. A non-optimal solution is made optimal by elementary row
operations
These two rules govern the row operation:
0.5.1 PIVOTING
The idea of pivoting is simply applyıng an elementary row operation to a matrix. This
is done by;
• selecting the pivot element (entry) multiplying the pivot row with the reciprocal
of the pivot element to convert the pivot element to unity (thus the value one).
THE PIVOT ELEMENT (ENTRY) is the ai j element, which is common to the
pivot row and the pivot column.
• The all other entries in the column of the A mat r i x should be made to go to zero
through elementary row operations.
21
0.6 TERMINATION RULE
After the pivoting has been done, then iteration has been completed for the simplex
method. So a new tableau will be set with the new ai j , b j , C j , basis, Z j , and C j - Z j ,
this new tableau is known as the current simplex tableau. It gives a new basis feasible
solution which may be an optimal solution.
Pivoting is stopped when the optimal solution is reached. One knows that the op-
timum is reached when all the entries in the net evaluation row are non-positive or
non-negative for maximization or minimization models respectively.
Example 1.7
Use the simplex method to solve the model in example 1.6
Solution
Maximize Z = 120x + 100y
Subject to
x+y ≤4
5x + 3y ≤ 15
x, y ≥ 0
This model is in the standard form. Adding slacks s 1 to constraint 1 and s 2 to constraint
2, we form the canonical system of equations.
22
The entering basic variable is x since the most positive value in the C j − Z j row is 120
and it corresponds to the column headed (labelled) x. The departing basic variable is s 2
since from the ratios bi /ai j = 15/5 = 3 and 4/1 = 4 gives 3 as the smallest non-negative
ratio and that corresponds to the s 2 row. Hence, the pivot element is 5.
23
2/5*R 1 −→ R 1new
-3/5*R 1 + R 2 −→ R 2new
This is the final simplest tableau for the model since all the entries in the C J − Z j
row are non-positive values. The optimum solution for the model is Z = 430, x = 3/2
and y = 5/2, s 1 = s 2 = 0.
example 2.8
2x 1 + x 2 + x 3 ≤ 12
8x 1 + 10x 2 + x 3 ≤ 90
4x 1 + 4x 2 + 3x 3 ≤ 30
x1 , x2 , x3 ≤ 0
Solution
Subject to 2x1 + x2 + x3 + s1 = 12
8x1 + 10x2 + x3 + s2 =90
4x1 + 4x2 + 3x3 + s3 = 30
x1 , x 2 , x 3 , s 1 , s 2 , s 3 ≥ 0
24
25
0.7 NONSTANDARD FORM OF LP MODELS
From the definition of standard form LP model, it implies that minimization problems
are not in the standard form and if the model contains a "≥" grater than or equal to or
(and) "=" equal to constraints, then that model is not in the standard form.
Any model that is not in the standard form is said to a nonstandard form LP model.
Example 2.9
1. Maximize Z = x 1 − 2x 2
subject to
2x 1 + 5x 2 ≤ 60
x 1 + x 2 ≥ 10
x1 , x2 ≥ 0
2. Maximize Z = x 1 − 2x 2
subject to
2x 1 + 5x 2 ≤ 60
x 1 + x 2 ≥ 10
x1 , x2 ≥ 0
3. Minimize C = 2x 1 − 4x 2
subject to
2x 1 + 3x 2 ≤ 5
x1 − x2 ≤ 4
x1 , x2 ≥ 0
4. Maximize C = −2x 1 + x 2 − 3x 3
subject to
2x 1 + 2x 2 + 3x 3 ≤ 10
2x 1 − x 2 + 3x 3 ≤ 9
x 1 + 3x 2 + 2x 3 ≥ 4
2x 1 − x 2 + 3x 3 ≥ 5
x i ≥ 0; 1 ≤ i ≤ 3
26
It can be seen from the above example model 1 is in the standard and hence its solution
follows the same partern of the models solved above. However, models 2 to 5 are in
the nonstandard form.
Nonstandard form models can also be solved through so many ways. Two os these
ways(methods) shall be discussed in this study.
A. For minimization model, multiply the objective function by negative one (-1) and
then maximize the new objective function. Thus from model 3 in Example 29; maxi-
mize C = 2x 1 − 4x 2 must be modified by multiplying through by -1.
Hence the modified model becomes, Z = −2x 1 + 4x 2 where Z = -C.
In this case, after the optimum solution had been obtained, the optimum value to the
original model (Minimization) is the negative of the optimum value obtained from the
modified objective function ( Maximization). Thus after the optimum solution had
been obtained, the value of Z should be negated to give the value of C. That is C= -Z.
B. For a greater than or equal to (≥) constraints, multiply through the constraint by
negative one (-1) to obtain a less than or equal to (≤) constraint. In this, the bi will
become negative values hence the basic solutions will not be a feasible solution. Thus,
the non-negative constraints will be violated. So we will use row operations to remove
these negative entries.
(ii) Determine the pivot column. This is the column corresponding to the smallest
non- negative ratio of entries in the bcol umn to tho entries in that row. That means,
form the ratio with the negative entries in the A mat r i x that are in the pivot row.
(iii) Pivot on the pivot entry, which is the entry common to both the pivot row and
column.
(iv) Repeat steps i, ii and iii until there are no negative entries in the bcol umn
2. Given maximize Z = x 1 − 2x 2
27
subject to
2x 1 + 5x 2 ≤ 60
x 1 + x 2 ≥ 10
x1 , x2 ≥ 0
2x 1 + 5x 2 ≤ 60
−x 1 − x 2 ≤ −10
x1 , x2 ≥ 0
solution
28
3. Given
MinimizeC = 2x 1 − 4x 2
subject to
2x 1 + 3x 2 ≤ 5
x1 − x2 ≤ 4
x1 , x2 ≥ 0
2x 1 + 3x 2 ≤ 5
x1 − x2 ≤ 4
x1 , x2 ≥ 0
Where D = -C.
Solution
29
Hence x 2 = 5/3, x 1 = 0, D = 20/3, but D = -C, this implies that C = -20/3
Therefore, the solution to the original problem(model) is x 2 = 5/3, x 1 = 0, D = -20/3
C. Two numbers "a" and "b" satisfy a ≤ b and a ≥ b if and only if "a = b".
Therefore for an "equal to" constraint, replace it with two inequality constraints.
thus for the constraint, 2x 1 − 3x 2 + x 3 = 8,
it should be replaced by 2x 1 − 3x 2 + x 3 ≤ 8 and 2x 1 − 3x 2 + x 3 ≥ 8
then the ≥constraint shall be treated as in B.
5x 1 − 2x 2 + 3x 3 ≥ 8
x 1 − x 2 + 2x 3 = 5
x 1 + 3x 2 + 2x 3 ≤ 12
x i ≥ 0; 1 ≤ i ≤ 3
30
subject to
−5x 1 + 2x 2 − 3x 3 ≤ −8
x 1 − x 2 + 2x 3 ≤ 5
−x 1 + x 2 − 2x 3 ≤ −5
x 1 + 3x 2 + 2x 3 ≤ 12
x i ≥ 0; 1 ≤ i ≤ 3
Solution
31
This is the final tableau and the solution to the original model is x 1 = 11/12, x 2 =
65/12, x 3 = 19/12, P = 747/2.
32
0.8 THE BIG-M METHOD
This is another method for solving Linear Programming problems in non-standard
form. This method introduces three kinds of non-negative variables: slack, Surplus
and artificial variables. The introduction of these variables coverts the non-standard LP
problems into a canonical system of linear equations to which the simplex method can
be applied.
Specifically:
(ii) to each "≥" constraint, first subtract a non- negative slack variable (or add a surplus
variable) then add an artificial variable.
The artificial variables which have been added to both the ≥ and = constraints actually
have nothing to do with the problem but only to give an initial basic feasible solution
since the artificial variable was added to start the simplex tableau, it has to be out of
the solution out of the solutions before the solution gets to the optimum.
To do this, we assign a very large cost(M) to the artificial variable in the objective func-
tion If the model is a Maximization model, then negative of the large cost is assigned
to each of the artificial variables. However, if the model is a Minimization model, then
positive large cost is assigned to the artificial variables.
Step 2. Select the pivot variable. The objective function is being minimized. There-
fore, it makes sense to select, as the pivot variable, the variable that causes the largest
reduction in the objective function. Thus, the variable associated with the most nega-
tive value in the C j − Z J , row.
Step 3. Select the pivot row. The pivot row is selected in precisely the same man-
ner as before. Thus, the smallest ratio (b j /ai j ).
33
Step 4. Pivot on the pivot-entry and perform row operations to generate new basis.
Step 5. Repeat steps 2,3 and 4 until optimality is reached. The optimal solution is
reached, when every entry in the net evaluation row is non - negative (this is directly
the opposite of the maximization optimality test).
Example 2.10
5x 1 − 2x 2 + 3x 3 ≥ 8
x 1 − x 2 + 2x 3 = 5
2x 1 + x 2 + x 3 ≤ 12
x i ≥ 0; 1 ≤ i ≤ 3
34