CHAPTER TWO
INTRODUCTION TO LINEAR PROGRAMMING
Linear Programming- is an optimization method, which shows how to allocate scarce
resources such as money, materials or time and how to do such allocation in the best
possible way subject to more than one limiting condition expressed in the form of
inequalities and/or equations.
It enables users to find optimal solution to certain problems in which the solution must
satisfy a given set of requirements or constraints.
Optimization in linear programming implies either maximization (such as profit, revenue,
sales, and market share) or minimization (such as cost, time, and distance) a certain
objective function. It implies that in LP we cannot max/min two quantities in one model.
It involves linearly related multi-variate functions, i.e., functions with more than one
independent variable.
The goal in linear programming is to find the best solution given the constraints imposed
by the problem; hence the term constrained optimization.
Solution Approaches to Linear Programming Problems
There are two approaches to solve linear programming problems:
1. The Graphic solution method
2. The Algebraic solution/ simplex algorithm method
A. The Graphic Solution Method
It is a relatively straightforward method for determining the optimal solution to certain
linear programming problems. It gives as a clear picture. This method can be used only to
solve problems that involve two decision variables. However, most linear programming
applications involve situations that have more than two decision variables, so the graphic
approach s not used to solve them.
E.g.: 1. Solving the micro-computer problem with graphic approach
Zmax = 60X1 + 50X2
: 4X1 + 10X2 100
2X1 + X2 22
3X1 + 3X2 39
X1, X2 0
1
Steps:
1. Plot each of the constraints and identify its region – make linear inequalities
linear equations.
2. Identify the common region, which is an area that contains all of the points
that satisfy the entire set of constraints.
3. Determine the Optimal solution- identify the point which leads to maximum
benefit or minimum cost.
24
22 2X1 + X2 = 22
20
16
3X1 + 3X2 = 39
12
(0, 13) E
8
(5, 8)D 4X1 + 10X2 = 100
4 (9, 4) C
(0, 0) A 4 8 B 12 16 20 24 28
To identify the maximum (minimum) value we use the corner point approach or the
extreme point approach. The corner point/extreme point approach has one theorem: It
states that;
For problems that have optimal solutions, a solution will occur at an extreme, or corner
point. Thus, if a problem has a single optimal solution, it will occur at a corner point. If it
2
has multiple optimal solutions, at least one will occur at a corner point. Consequently, in
searching for an optimal solution to a problem, we need only consider the extreme points
because one of those must be optimal. Further, by determining the value of the objective
function at each corner point, we could identify the optimal solution by selecting the
corner point that has the best value (i.e., maximum or minimum, depending on the
optimization case) at the objective function.
Determine the values of the decision variables at each corner point. Sometimes, this can
be done by inspection (observation) and sometimes by simultaneous equation.
- Substitute the value of the decision variables at each corner point.
After all corner points have been so evaluated, select the one with the highest or lowest
value depending on the optimization case.
Points Coordinates How Determined Value of Objective function
X1 X2 Z = 60X1 + 50X2
A 0 0 Observation Birr 0
B 11 0 Observation Birr 660
C 9 4 Simultaneous Birr 740
equations
D 5 8 Simultaneous Birr 700
equations
E 0 10 Observation Birr 500
Basic solution
X1 = 9
X2 = 4
Z = Birr 740
After we have got the optimal solution, we have to substitute the value of the decision
variables into the constraints and check whether all the resources available were used or
not. If there is an unused resource we can use it for any other purpose. The amount of
unused resources is known as SLACK-the amount of the scarce resource that is unused by
a given solution.
3
The slack can range from zero, for a case in which all of a particular resource is used, to
the original amount of the resource that was available (i.e., none of it is used).
Computing the amount of slack
Constraint Amount used with X1 Originally Amount of slack
= 9 and X2 = 4 available (available – Used)
Assembly time 4(9) + 10(4) = 76 100 hrs 100 – 76 = 24 hrs
Inspection time 2(9) = 1 (4) = 22 22 hrs 22 – 22 = 0 hr
Storage space 3(9) + 3(4) = 39 39 cubic ft 39 – 39 = 0 cubic ft
Constraints that have no slack are some time referred to as binding constraints since they
limit or bind the solution. In the above case, inspection time and storage space are
binding constraints; while assembly time has slack.
Knowledge of unused capacity can be useful for planning. A manager may be able to use
the assembly time for other products, or, perhaps to schedule equipment maintenance,
safety seminars, training sessions or other activities.
Interpretation: The Company is advised to produce 9 units of type 1 microcomputers
and 4 units of type 2 microcomputers per week to maximize its weekly profit to Birr 740;
and in do so the company would be left with unused resource of 24-assembly hrs that can
be used for other purposes.
2. Solving the diet problem with graphic approach
Cmin: 5X1 + 8X2
10X1 + 30X2 140
20X1 + 15X2 145
X1, X2 0
16
4
12
20X1 + 15X2 = 145
(0, 9.67) A
8
10X1 + 30X2 = 140
4 B (5, 3)
C (14,0)
4 8 12 16 20
Points Coordinates How Determined Value of the objective function
X1 X2 Z = 5X1 + 8X2
A 0 9.67 Observation Birr 77.30
B 5 3 Simultaneous Birr 49
equations
C 14 0 Observation Birr 70
Basic solution: X1 = 5 pounds
X2 = 3 pounds
C = Birr 49
Interpretation: To make the diet at the minimum cost of Birr 49 we have to purchase 5
pounds of Type1 food and 3 pounds Type 2 food.
If there is a difference between the minimum required amount and the optimal solution,
we call the difference surplus: That is, Surplus is the amount by which the optimal
solution causes a constraint to exceed the required minimum amount. It can be
determined in the same way that slack can: substitute the optimal values of the decision
variables into the left side of the constraint and solve. The difference between the
resulting value and the original right-hand side amount is the amount of surplus. Surplus
can potentially occur in a constraint.
5
B. The Simplex Algorithm/Algebraic Solution Method
The simplex method is an iterative technique that begins with a feasible solution that is
not optimal, but serves as a starting point. Through algebraic manipulation, the solution is
improved until no further improvement is possible (i.e., until the optimal solution has
been identified). Each iteration moves one step closer to the optimal solution. In each
iteration, one variable that is not in the solution is added to the solution and one variable
that is in the solution is removed from the solution in order to keep the number of
variables in the basis equal to the number of constraints.
The optimal solution to a linear programming model will occur at an extreme point of the
feasible solution space. This is true even if a model involves more than two variables;
optimal solutions will occur at these points. Extreme points represent intersections of
constraints. Of course, not every solution will result is an extreme point of the feasible
solution space; some will be outside of the feasible solution space. Hence, not every
solution will be a feasible solution. Solutions which represent intersections of constraints
are called basic solutions; those which also satisfy all of the constraints, including the
non-negativity constraints, are called basic feasible solutions. The simplex method is an
algebraic procedure for systematically examining basic feasible solutions. If an optimal
solution exists, the simplex method will identify it.
The simplex procedure for a maximization problem with all constraints consists of the
following steps.
1. Write the LPM in a standard form: when all of the constraints are written as
equalities, the linear program is said to be in standard form. We convert the LPM in to a
standard form by applying the slack variables, S, which carries a subscript that denotes
which constraint it applies to. For example, S 1 refers to the amount of slack in the first
constraint, S2 to the amount of slack in the second constraint, and so on. When slack
variables are introduced to the constraints, they are no longer inequalities because the
slack variable accounts for any difference between the left and right-hand sides of an
expression. Hence, once slack variables are added to the constraints, they become
6
equalities. Furthermore, every variable in a model must be represented in the objective
function. However, since slack does not provide any real contribution to the objective,
each slack variable is assigned a coefficient of zero in the objective function.
Basic Definitions
Before using the simplex method, let us examine and understand certain basic terms
involved in the procedure.
1. Standard Form: This has already been clarified in the initial part of this chapter. With
linear relationships of objective function and constraints, making RHS of constraints as
equal produces standard form, whereas the inequality situation is called canonical form.
2. Slack and Artificial Variables: These have also been explained under an appropriate
heading. Their physical significance have also been clarified. These are generally
designated as S1, S2 . . . . etc. and A1, A2 etc. respectively. Whereas the slack variables
indicate spare capacity of the constraints, artificial variables are imaginary variables
added for standard form.
Surplus Variable: A variable subtracted from the left hand side of a greater than or equal
to constraint to convert the constraint into equality. Physical sense or interpretation of the
surplus variable is that it is amount of resource over and above the minimum required
level. In case the constraint inequality is of the type "less than or equal to", then it is
called slack variable.
4. Basic Solution: There may be n variables and m constraints in a linear programming
problem. When we evaluate the solution of this problem by setting (n - m) of the
variables to zero and solve the other m variable equations, we obtain a unique solution. It
is called "Basic Solution".
5. Basic Feasible Solution: When a basic solution satisfies even the non-negativity
requirement is called Basic Feasible Solution. Since it has to be within the feasible region
as explained at point 4.7 (graphical method), a basic feasible solution corresponds to a
comer point of the feasible region.
6. Simplex Table: A table used for calculations during various iterations
of the simplex procedure, is called Simplex table.
Variable Mix: The values of the column that contains all the variables
in the solution.
7
8. Basis: The set of variables which are not set to zero and figure in the column of
"Product Mix" are said to be in the 'Basis'. Other than these figuring in the product mix
column are termed as non basic variables.
9. Iteration: Since the simplex procedure is that of constant improvement type from one
basic feasible solution to another, these steps of moving from one solution to another to
reach optimal solution are called Iterations.
10. Cj Row: It is the row containing the coefficients of all the variables (decision
variables, slack or artificial variables) in the objective function.
11. Constraints: Restrictions on the problem solution arising from limited resources.
12. Cj - Zj = Δj or Index Row: The row containing net profit or loss resulting from
introducing one unit of the variable in that column in the solution. A positive number in
the Δj row would indicate an algebraic reduction or increment in the objective function if
one unit of the variable of that column is introduced in the basis.
13. Pivot -Column: The column with the largest positive number in Cj - Zj row in a
maximization problem or the smallest number in a minimization problem is called Pivot
column. This indicates the variable entering the solution in the next iteration by replacing
an appropriate variable.
14. Pivot Row: When we work out the ratio of quantities bi's and the elements of the
Pivot column, we get the last column of the simplex table. The outgoing variable to be
replaced by the entering variable (decided by the key row) would be the one with the
smallest positive value of the ratio column.
15. Pivot Element: The element at the point of intersection of the key column and the key
row is called the Pivot element.
16: Optimal Solution: The best of all feasible solutions.
17: Linear Function: A mathematical expression in which a linear relationship exists
amongst various variables.
Slack = Requirement – Production, surplus = Production – Requirement
Taking the microcomputer problem its standard form is as follows:
8
Zmax = 60X1 + 50X2 Zmax = 60X1 + 50X2 + 0S1 + S2 + 0S3
: 4X1 + 10X2 100 : 4X1 + 10X2 + S1 = 100
2X1 + X2 22 2X1 + X2 + S2 = 22
3X1 + 3X2 39 3X1 + 3X2 + S3 = 39
X1, X2 0 X1, X2, S1, S2, S3 0
2. Develop the initial tableau: the initial tableau always represents the “Do Nothing”
strategy, so that the decision variables are initially non-basic.
a) List the variables across the top of the table and write the
objective function coefficient of each variable jut above it.
b) There should be one row in the body of the table for each
constraint. List the slack variables in the basis column, one per raw.
c) In the Cj column, enter the objective function coefficient of zero
for each slack variable. (Cj - coefficient of variable j in the objective function)
d) Compute values for row Zj
e) Computer values for Cj – Zj.
Sol/n Cj 60 50 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
S1 0 4 10 1 0 0 100 100/4 = 25
S2 0 2* 1 0 1 0 22 22/2 = 11 Leaving
S3 0 3 3 0 0 1 39 39/3 = 13 variable
Zj 0 0 0 0 0 0
Cj-Zj 60 50 0 0 0 0
Entering variable Pivot column Pivot row
* Pivot Element
9
3. Develop subsequent tableaus
3.1. Identify the entering variable - a variable that has a largest positive value is the Cj –
Zj raw.
3.2. Identify the leaving variable - Using the constraint coefficients or substitution rates
in the entering variable column divide each one into the corresponding quantity
value. However do not divide by a zero or negative value. The smallest non-
negative ratio that results indicate which variable will leave the solution.
4. Find unique vectors for the new basic variable using row operations on the pivot
element.
Sol/n Cj 60 50 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
S1 0 0 8 1 -2 0 56 56/8 = 7
X1 60 1 1/2 0 1/2 0 11 11/. 5 = 22
S3 0 0 3/2 0 -3/2 1 6 6/1.5 = 4
Zj 60 30 0 30 0 660
Cj-Zj 0 20 0 -30 0 0
Leaving variable
Entering Variable
Sol/n Cj 60 50 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
S1 0 0 0 1 6 -16/3 24
X1 60 1 0 0 1 -1/3 9
X2 50 0 1 0 -1 2/3 4
Zj 60 50 0 10 40/3 740
Cj-Zj 0 0 0 -10 -40/3
Optimal solution: X1 = 9
X2 = 4
10
S1 = 24 hrs
Z = Birr 740
5. Compute the Cj – Zj raw
6. If all Cj – Zj values are zeros and negatives you have reached optimality.
7. If this is not the case (step 6), rehear step 2to5 until you get optimal solution.
“A simplex solution is a maximization problem is optimal if the Cj – Zj row consists
entirely of zeros and negative numbers (i.e., there are no positive values in the bottom
row).”
Note: The variables in solution all have unit vectors in their respective columns for
the constraint equations. Further, note that a zero appears is raw c - z in every
column whose variable is in solution, indicating that its maximum contribution to
the objective function has been realized.
Example 2
A manufacturer of lawn and garden equipment makes two basic types of lawn mowers: a
push-type and a self-propelled model. The push-type requires 9 minutes to assemble and
2 minutes to package; the self-propelled mower requires 12 minutes to assemble and 6
minutes to package. Each type has an engine. The company has 12 hrs of assembly time
available, 75 engines, and 5hrs of packing time. Profits are Birr 70 for the self-propelled
models and Birr 45 for the push-type mower per unit.
Required:
1. Formulate the linear programming models for this problem.
2. Determined how many mower of each type to make in order to maximize the total
profit (use the simplex procedure)
Solution:
1.
a) To determine ho many units of each types of mowers to produce so as
to maximize profit.
11
b) Let X1 - be push type mower.
X2 - be self-propelled mower.
c) Determine the objective function
Zmax = 45X1 + 70X2
d) Identify constraints
9X1 + 12X2 720 minutes Assembly time
2X1 + 6X2 300 minutes packing time
X1 + X2 75 engines Engines
X1, X2 0
In summary:
Zmax = 45X1 + 70X2
: 9X1 + 12X2 720
2X1 + 6X2 300
X1 + X2 75
X1, X2 0
2.
a. Write the LPM in a standard form
Zmax = 45X1 + 70X2 + OS1 + OS1 + OS3
: 9X1 + 12X2 + S1 = 720
2X1 + 6X2 + S2 = 300
X1 + X2 + S3 = 75
X1, X2, S1, S2, S3 o
b. Develop the initial tableau – in LP matrices are commonly called tableaus
Sol/n Cj 45 70 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
S1 0 9 12 1 0 0 720 720/12 =60
S2 0 2 6 0 1 0 300 300/6 =50 Leaving
S3 0 1 1 0 0 1 75 75/1 = 75 variable
Zj 0 0 0 0 0 0
Cj-Zj 45 70 0 0 0
12
Entering variable
c. Develop the subsequent tableaus
- Identify the entering variable
- Identify the leaving variable
Sol/n Cj 45 70 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
S1 0 5 0 1 -2 0 120 120/5 = 24 Leaving
X2 70 1/3 1 0 1/6 0 50 50/. 333 =150 variable
S3 0 2/3 1 0 -1/6 1 25 25/.666 = 75
Zj 70/3 70 0 70/6 0 3500
Cj-Zj 65/3 0 0 -70/6 0
Entering variable
Sol/n Cj 45 70 0 0 0
basis X1 X2 S1 S2 S3 RHSV Øj = bj/xj (aij)
X1 45 1 0 1/5 -2/5 0 24
X2 70 0 1 -1/15 3/10 0 42
S3 0 0 0 -2/15 1/10 1 9
Zj 45 70 13/3 3 0 4020
Cj-Zj 0 0 -13/3 -3 0
Optimal solutions: X1 = 24 units
X2 = 42 units
S3 = 9 engines
Z = Birr 4020
Interpretation: The Company is advised to produce 24 units of push type mowers and
42 units of self-propelled mowers so as to realize a profit of Birr
13
4020. In doing so the company would be left with unused resource of
9 engines which can be used for other purposes.
3. A firm produces products A, B, and C, each of which passes through assembly and
inspection departments. The number of person hours required by a unit of each product in
each department is given in the following table.
Person hours per unit of product
Product A Product B Product C
Assembly 2 4 2
Inspection 3 2 1
During a given week, the assembly and inspection departments have available at most
1500 and 1200 person-hours, respectively. if the unit profits for products A, B, and C are
Birr 50, Birr 40, and Birr 60, respectively, determine the number of units of each product
that should be produced in order to maximize the total profit and satisfy the constraints of
the problem.
Answer: 0 unit of product A, 0 unit of product B, 750 units of product C, unused
inspection time of 450 hours, and a maximum profit, Z ,of Birr 45,000.
4. The state chairman of a political party must allocate an advertising budget of birr
3,000,000 among three media: radio, television, and newspapers. The expected number of
votes gained per birr spent on each advertising medium is given below.
Expected votes per Birr spent
Radio Television Newspapers
3 5 2
Since these data are valid with in the limited amounts spent on each medium, the
chairman has imposed the following restrictions:
No more than Birr 500,000 may be spent on television ads.
No more than Birr 1,200,000 may be spent on radio ads.
No more than Birr 2,400,000 may be spent on television and newspaper ads
combined.
14
How much should be spent on each medium in order to maximize the expected number
of votes gained?
Answer: Birr 500,000 should be spent on radio ads.
Birr 1,200,000 should be spent on television ads.
Birr 1,200,000 should be spent on newspaper ads.
Slack in the budget constraint is Birr 100,000.
Z = 9,900,000 is the maximum expected number of votes gained.
Some special Issues in L
1. Unbounded solutions
A solution is unbounded if the objective function can be improved without limit. The
solution is unbounded if there are no positive ratios in determining the leaving variable.
A negative ratio means that increasing a basic variable would increase resources! A zero
ratio means that increasing a basic variable would not use any resources. This condition
generally arises because the problem is incorrectly formulated. For example, if the
objective function is stated as maximization when it should be a minimization, if a
constraint is stated when it should be, or vice versa.
2. Multiple optimal solutions
The same maximum value of the objective function might be possible with a number of
different combinations of values of the decision variables. This occurs because the
objective function is parallel to a binding constraint. With simplex method this condition
can be detected by examining the Cj – Zj row of the final tableau. If a zero appears in the
column of a non-basic variable (i.e., a variable that is not in solution), it can be concluded
that an alternate solution exists.
E.g. Z = 60X1 + 30X2
4X1 + 10X2 100
2X1 + X2 22
3X1 + 3X2 39
X1, X2 0
The other optimal corner point can be determined by entering the non-basic variable with
the C - Z equal to zero and, then, finding the leaving variable in the usual way.
15
3. Degeneracy
In the process of developing the next simplex tableau for a tableau that is not optimal, the
leaving variable must be identified. This is normally done by computing the ratios of
values in the quantity column and the corresponding row values in the entering variable
column, and selecting the variable whose row has the smallest non-negative ratio. Such
an occurrence is referred to degeneracy, because it is theoretically possible for
subsequent solutions to cycle (i.e., to return to previous solutions). There are ways of
dealing with ties in a specific fashion; however, it will usually suffice to simply select
one row (variable) arbitrarily and proceed with the computations.
Limitations of linear programming
1. In linear programming uncertainty is not allowed, i.e., LP methods are applicable
only when values for costs, constraints, etc. are known, but in real life such factors may
be unknown.
2. According to the LP problem, the solution variables can have any value, whereas
sometimes it happens that some of the variables can have only integral values. For
example, in finding how may machines to be produced; only integral values of decision
variables are meaningful. Except when the variables have large values, rounding the
solution to the nearest integer will not yield an optimal solution. Such situations justify
the use of Integer Programming.
3. Many times, it is not possible to express both the objective function and
constraints in linear form.
16