Operations Research
Operations Research
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 an 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) of a certain objective function. It
implies that we cannot max/min two quantities in one model in LP. 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.
1. The Objective Function- is the mathematical or quantitative expression of the objective of the
company/model. The objective in problem-solving is the criterion by which all decisions are
evaluated. In LPMs a single quantifiable objective must be specified by the decision maker. For
1. Linearity. The linearity requirement is that each decision variable has a linear impact on the
objective function and on each constraint in which it appears. Following the above example,
Once a problem has been defined, the attention of the analyst shifts to formulating a
formulate the model that will be used to solve the problem. If the LP model is ill-
* Once the variables have been identified, the objective function can be specified. It
- System constraints
- Individual constraints
- Non-negative constraints
Example
1. A firm that assembles computers and computer equipment is about to start production of
two new microcomputers. Each type of micro-computer will require assembly time,
inspection time, and storage space. The amount of each of these resources that can be
devoted to the production of microcomputers is limited. The manager of the firm would
like to determine the quantity of each microcomputer to produce in order to maximize the
Additional information
In order to develop a suitable model of the problem, the manager has met with design and
manufacturing personnel. As a result of these meetings, the manager has obtained the
following information:
Type 1 Type 2
The manager also has acquired information on the availability of company resources.
the microcomputers was such that whatever combination of these two types of
Solution:
(and sold) per week so as to maximize the weekly profit given the restriction.
respectively.
Individual constraint No
2X1 + X2 22
X1 + 3X2 39
X1, X2 0
2. An electronics firm produces three types of switching devices. Each type involves a two-
step assembly operation. The assembly times are shown in the following table:
Section #1 Section #2
Each workstation has a daily working time of 7.5 hrs. The manager wants to obtain the
greatest possible profit during the next five working days. Model A yields a profit of Birr
8.25 per unit, Model B a profit of Birr 7.50 per unit, and Model C a profit of Birr 7.80 per
unit. Assume that the firm can sell all it produces during this time, but it must fill
Solution:
sold for the next 5 working days so as to maximize the 5 days’ profit.
Let X1, X2, and X3 be the number of Model A, B, and C switching devices
requirements are to be obtained from two types of foods: Type 1 and Type 2. Type 1 food
contains 10Mgs of vitamin A and 20mgs of vitamin B per pound. Type 2 food contains
30mgs of vitamin A and 15 mgs of vitamin B per pound. If type 1 and 2 foods cost Birr 5
and Birr 8 per pound respectively, how many pounds of each type should be purchased
Vitamins
Foods A B
Type 1 10 20
Type 2 30 15
Solution:
To determine the pounds of the two types of foods to be purchased to make the diet
Let X1 and X2 be the number of pounds of type 1 and type 2 foods to be purchased,
respectively.
A Maximization Problem
Example: Consider two models of color TV sets; Model A and B, which are produced by a
company to maximize profit. The profit realized is $300 from A and $250 from set B. The
limitations are
A. availability of only 40hrs of labor each day in the production department.
B. a daily availability of only 45 hrs on machine time
C. ability to sell 12 sets of model A.
How many sets of each model will be produced each day so that the total profit will be as
large as possible?
Resources used per unit
Constraints Model A Model B Maximum Available hrs.
(X1) (X2)
Labor hr. 2 1 40
Machine hr. 1 3 45
Marketing hr. 1 0 12
Profit $300 $250
X2
X1=0
40 X1=12
B
X1 +3X2 = 45
15
Assembly department 3 4 84
*The distributor will not take more than 12 SUPER tents per week. Thus, the manufacturer
should not produce more than 12 SUPER tents per week.
Let X1 =The No of REGULAR tents produced per week.
X2 =The No of SUPER tents produced per week.
X1 and X2 are called the decision variables
X2
X1 =0
21
16
B Minimization Problem
Example:
Suppose that a machine shop has two different types of machines; machine 1 and machine 2, which
can be used to make a single product. These machines vary in the amount of product produced
per hr., in the amount of labor used, and in the cost of operation. Assume that at least a certain
amount of product must be produced and that we would like to utilize at least the regular labor
Solution
Min.Z = 25 X 1+30 X 2
St :
20 X 1+15 X 2 100 LPP Model
2 X 1+3 X 2 15
X1, X 2 0
Constraint equation:
20X1 +15X2=100 ==> (0, 20/3) and (5, 0)
2X1+3X2=15 ==> (0, 5) and (7.5, 0)
X1 X2> 0
X2
X1 =0
A (0, 20/3)
Feasible Region
B (2.5, 3.33)
X2 =0
X1
5 C (7.5, 0)
X1 =2.5
X2=3.33 and
MinZ= 162.5dollar
6 X 1+2 X 2= 12
(0, 6), (2, 0)
2 X 1+2 X 2= 8
(0, 4), (4, 0)
4 X 1 + 12 X 2 = 24
(0, 2), (6, 0)
X1, X 2 = 0
Corners MinZ=$1000 X1 + 800X2
(0, 6) $4800
(1, 3) $3400
(3, 1) $3800
(6, 0) $6000
X1 =1
X2=3 and
MinZ= $3400
Note:
-In maximization problems, our point of interest is looking at the furthest point from the origin.
-In minimization problems, our point of interest is looking at the point nearest to the origin.
2.3. SPECIAL CASES IN GRAPHICS METHODS
1. Redundant Constraint
If a constraint when plotted on a graph doesn’t form part of the boundary making the feasible region
of the problem that constraint is said to be redundant.
Example:
A firm is engaged in producing two products A and B. Each unit of product A requires 2 kg of raw
materials and 4 labor-hrs for processing. Whereas each unit of product B requires 3 kg of raw
materials and 3hrs of labor. Every unit of product A needs 4hrs to package and every unit of product
B needs 3.5 hours to package. Every week the firm has availability of 60 kg of raw materials, 96
labor hours, and 105 hrs in the packaging department. 1 unit of product A sold yields a Br. 40 profit
and 1 unit of B sod yield Br. 35 profit.
Required:
a. Formulate this problem as a LPP
b. Find the optimal solution
Solution
X2
(0, 32)
A (0, 0) 0
B (0, 20) 700
C (18, 8) 1000
D (24, 0) 960
X1 =18
X2=8 and
MinZ= 1000
Interpretation:
The company should produce and sell 18 units of product A and 8 units of product B per week so
as to get a maximum profit of 1000.
❖ By this production plan the entire raw material will be consumed.
2X1 +3X2 <60
Example:
The information given below is for products A and B.
Department Product A Product B Maximum available per week
Cutting 3 6 900
Assembly 1 1 200
Profit per unit Br.8 Br.16
Assume that the company has a marketing constraint on selling product B and therefore it can sell
a maximum of 125 units of this product.
Required:
a. Formulate the LPP of this problem
b. Find the optimal solution
AMU, Department of Management 16 | P a g e
Solution:
Let X1 =The No of units f product A produced per week
X2 =The No of units f product B produced per week
a. The LPP Model of the problem is:
Max.Z = 8 X 1+16 X 2
St :
3 X 1+6 X 2 900
X 1+ X 2 200
X 2 125
X1, X 2 0
X1=0
X2
(0, 200)
FR X2=0
X1
A (0, 0) E (200, 0) (300,0)
Interpretation:
Both C and D are optimal solutions. Any point on the line segment CD will also lead to the same
optimal solution.
==>Multiple optimal solutions provide more choices for management to reach their objectives.
A solution is called feasible if it satisfies all the constraints and the constraints and non-negativity
condition. However, it is sometimes possible that the constraints may be inconsistent so that there
is no feasible solution to the problem. Such a situation is called infeasibility.
Example:
MaxZ=20X1+30X2
St:
2X1+X2< 40
4X1+X2< 60
X1 > 30
X1, X2 > 0
Solution:
X2 X1=0
(0, 60) X1=30
4X1+X2= 60
(0, 40)
2X1+X2= 40
X2=0
X1
(15, 0) (20, 0) (30, 0)
Note:
-In the above graph, there is no common point in the shaded area.
-All constraints cannot be satisfied simultaneously and there is no feasible solution to the problem.
4. Mix of constraints
Example:
ABC gasoline company has two refineries with different production capacities. Refinery A can
produce 4,000 gallons per day of super unleaded gasoline, 2000 gallons per day of regular
_________________________________________________________________
Interpretation:
The oil company should operate refinery A for 12 days and refinery B for 6 days at a minimum
operating cost of $32,400.
c. Is there any overproduction
SUG: 4000X1+1000X2>24000
4000(12) +1000(6)>24000
54000 > 24000
Therefore, 30,000 gallons overproduction
X1+X2 =0
Unbounded
1 Feasible Region
X1
A(0,3) Unbounded
Feasible Region
X1-X2=1
B (2, 1)
X1+X2=3
X1
Note: here that the two corners of the region are A (0,3) and B (2,1). The value of MaxZ (A)=6 and
MaxZ (B)=8. But there exist a number of points in the shaded region for which the value of the
objective function is more than 8. For example, point (10, 12) lies in the region, and the function
value at this point is 70 which is more than 8.
Remark:
An unbounded solution does not mean that there is no solution to the given LPP but implies that
there exists an infinite number of solutions.
In 1940’s George B.Dantzig developed an algebraic approach called the Simplex Method which is
an efficient approach to solving applied problems containing numerous constraints and involving
many variables that cannot be solved by the graphical method.
The simplex method is an ITERATIVE or “step by step” method or repetitive algebraic approach that moves
automatically from one basic feasible solution to another basic feasible solution improving the situation each
time until the optimal solution is reached.
Note:
The simplex method starts with a corner that is in the solution space or feasible region and moves
to another corner. The solution space improves the value of the objective function each time until
an optimal solution is reached at the optimal corner.
In general, whenever there are n variables and m constraints (excluding the non-
negativity), where m is less than n (m<n), n-m variables must be set equal to zero before
the solution can be solved algebraically.
Or: basic variables are variables that are in the basic solution. Basic variables have
0 values in the Cj-Zj row.
Or: non-basic variables are variables that are out of the solution.
AMU, Department of Management 24 | P a g e
==>n=5 variables (x1, x2, s1, s2, and s3) and m=3 constraints (Labor, machine, and marketing
constraints), excluding non-negativity.
Therefore, n-m=5-3=2 variables (x1 and x2) are set equal to zero in the 1st simplex tableau.
These are non-basic variables. 3 Variables (s1, s2, and s3) are basic variables (in the 1st simplex
tableau) because they have non-zero solution values.
Slack variables
variables column
Solution quantity
columns
Basic or Solution
Real or decision
variable column
Profit per unit
column
column
Profit per unit row
Cj 300 250 0 0 0
SV X1 X2 S1 S2 S3 Q
0 S1 2 1 1 0 0 40 R1
Constraint
0 S2 1 3 0 1 0 45
equation rows R2
0 S3 1 0 0 0 1 12 R3
Zj 0 0 0 0 0 0 Gross Profit row
Note: RR>0
The variable leaving the solution is called leaving variable or outgoing variable.
The row associated with the leaving variable is called the key or pivot row (s3 column
in our case)
The element that lies at the intersection of the pivot column and pivot row is called the
pivot element (No 1 in our case)
Step 7: Repeat step 3-5 till an optimum basic feasible solution is obtained.
Or: repeat steps 3-5 till no positive value occurs in the Cj - Zj row.
Note:
Divide each element of the pivot row by the pivot element to find new values in the
key or pivot row.
Perform row operations to make all other entries for the pivot column equal to zero.
2nd simplex tableau
Cj 300 250 0 0 0
SV X1 X2 S1 S2 S3 Q
0 S1 0 1 1 0 -2 16
0 S2 0 3 0 1 -1 33
300 X1 1 0 0 0 1 12
Zj 300 0 0 0 300
C j - Zj 0 250 0 0 -300
Cj 300 250 0 0 0
SV X1 X2 S1 S2 S3 Q
0 S1 0 0 1 -1/3 -5/3 17/3
250 X2 0 1 0 1/3 -1/3 31/3
300 X1 1 0 0 0 1 12
Zj 300 250 0 250/3 650/3 6350
C j - Zj 0 0 0 -250/3 - 650/3
An artificial variable is a variable that has no meaning in a physical sense but acts as a
tool to create an initial feasible LP solution.
Note:
Type of constraint To put into standard form
< --------------------------------------------- Add a slack variable
= ---------------------------------------------Add an artificial variable
> ---------------------- Subtract a surplus variable and add an artificial variable
The Big-M Method is a method that is used in removing artificial variables from the basis.
In this method; we assign coefficients to artificial variables, undesirable from the objective
function point of view. If objective function Z is to be minimized, then a very large positive
price (called penalty) is assigned to each artificial variable. Similarly, if Z is to be
maximized, then a very large negative price (also called a penalty) is assigned to each of
these variables.
Cj 25 30 0 0 M M
SV X1 X2 S1 S2 A1 A2 Q RR
M A1 20 15 -1 0 1 0 100
100/20=5
M A2 2 3 0 -1 0 1 15 15/2=7.5
R1 NEW=R1 OLD/20
R2 NEW=R2 OLD-2R1 NEW
Note:
Once an artificial variable has left the basis, it has served its purpose and can therefore be
removed from the simplex tableau. An artificial variable is never considered for re-entry
into the basis.
SV X1 X2 S1 S2 A2 Q
25 X1 1 3/4 -1/20 0 0 5
M A2 0 3/2 1/10 -1 1 5
Cj - Zj 0 45/4-3/2M 5/4-1/10 M M 0
Cj 25 30 0 0
SV X1 X2 S1 S2 Q
Duality Advantage
1. The dual form provides an alternative form
2. The dual reduces the computational difficulties associated with some formulation
3. The dual provides an important economic interpretation concerning the value of scars resources
used.
Example:
Write the duals to the following problems
a. Max.Z=5x1+6x2
Subject to:
2x1+3x2 < 3000 (Labor constraint)
5x1 + 7x2 < 1000 (Machine constraint)
x1 + x2 < 5000 (Market constraint)
x1, x2 > 0
Solution
Represent primal in the conventional table as follows
Dual variables x1 x2 Constraints
2u1+5u2 + u3> 5
3u1+7u2 + u3> 6
u1, u2 , u3> 0
Note:
1. For maximizing, all constraints must be brought to “<” form
2. For minimizing, all constraints must be brought to “>” form
3. If they are not, use multiplication factor -1
4. “=” is an intersection of “>” and “< “
b. Max.Z=60x1+50x2
Subject to:
2x1+4x2 < 80
3x1 + 2x2 < 60
x1 < 15
2x2 < 36
x1, x2 > 0
Solution
Primal is represented in the table as follows:
Dual variables x1 x2 Constraints
u1 2 4 < 80
u2 3 2 < 60
u3 1 0 < 15
u4 0 2 < 36
MaxZ 60 50
2u1+3u2 + u3 > 60
4u1+2u2 + u4 > 50
u1, u2, u3, u4 > 0
c. Obtain the dual problem of the following primal LPP
Min.Z=10x1+2x2
Subject to:
2x1+4x2 < 160
x1 +2x2 = 30
x1 > 10
x1, x2 > 0
2.5 SPECIAL CASES IN SIMPLEX METHOD
1. Mixed constraints
Example
Max Z=6x1 +8x2
Subject to:
x2 < 4
x1+ x2 = 9
6x1+ 2x2 >24
x1, x2 > 0
• Standard form
Max.Z=6x1 +8x2 + 0 s1 +0 s2+ 0 s3-M A2- M A3
St:
x2 + s1 =4
x1+ x2 + A2 =9
Standard form
6x1+2x2 - s3 + A3 =24
All Variables >0
Initial simplex tableau
Cj 6 8 0 0 -M -M
SV X1 X2 S1 S3 A2 A3 Q
0 S1 0 1 1 0 0 0 4
-M A2 1 1 0 0 1 0 9
-M A3 6 2 0 -1 0 1 4
Zj -7M -3M 0 +M -M -M 24
Cj
SV X1 X2 S1 S3 Q
Zj
C j - Zj 5 2 5 0
3. Infeasibility
A situation with no feasible solution may exist if the problem was formulated improperly.
Infeasibility comes about when there is no solution that satisfies all of the problem’s constraints.
Cj 5 8 0 0 M
SV X1 X2 S1 S2 A2 Q
5 X1 1 1 -2 3 0 200
8 X2 0 1 1 2 0 100
M A2 0 0 0 -1 1 20
Zj 5 8 -2 31-M M 1,800+200M
C j - Zj 0 0 2 M-31 0
Even though all Cj - Zj are positive or 0 (i.e the criterion for an optimal solution in a minimization
case), no feasible solution is possible because an artificial variable (A2) remains in the solution
mix.
4. Unbounded Solutions
No finite solution may exist in problems that are not bounded. This means that a variable can be
infinitely large without violating a constraint.
In the simplex method, the condition of unboundedness will be discovered prior to reaching the
final tableau. We will note the problem when trying to decide which variable to remove from the
solution mix.
The procedure in unbounded solution is to divide each quantity column number by the
corresponding pivot column number. The row with the smallest positive ratio is replaced. But if
the entire ratios turn out to be negative or undefined, it indicates that the problem is unbounded.
Example:
Maximization case
Cj 6 9 0 0
SV X1 X2 S1 S2 Q RR
9 X2 -1 1 2 0 30
0 S2 -2 0 -1 1 10 30/-1=-30
Unacceptable RRs
Zj -9 9 18 0 270 10/-2=-5
C j - Zj 15 0 -18 0
Pivot Column
5. Degeneracy
/Tie for leaving basic variable (key row)/
If there is a tie for the smallest ratio, this is a signal that degeneracy exists. Degeneracy can occur
right in the first (initial tableau). This normally happens when the number of constraints is less
than the number of variables in the objective function. Problem can be overcome by trial-and-error
method.
Cj 5 8 2 0 0 0
SV X1 X2 X3 S1 S2 S3 Q
RR
8 X2 1/4 1 1 -2 0 0 10
10/1/4=40
0 S2 4 0 1/3 -1 1 0 20
20/4=5 Tie for the smallest ratio
0 S3 2 0 2 2/5 0 1 10 indicates degeneracy.
10/2=5
Zj 2 8 8 16 0 0 80
Cj-Zj 3 0 -6 -16 0 0
Degeneracy could lead to a situation known as cycling, in which the simplex algorithm alternatives
back and forth between the same non-optimal solutions, i.e, it puts a new variable in, then takes it
out in the next tableau, puts it back in, and so on.
One simple way of dealing with the issue is to select either row (S2 or S3 in this case) arbitrary. If
we are unlucky and cycling does occur, we simply go back and select the other row.
Remark
When there is a tie between a slack and artificial variable to leave the basis, the preference shall be
given to artificial variable to leave the basis and there is no need to apply the procedure for
resolving such cases.
Note:
Instead of resolving the entire problem as a new problem with new parameters, we may take
the original optimal solution table as an initial solution table for the purpose of knowing ranges
both lower and upper within which a parameter may assume value.
Example:
Max.Z=5x1 +4.5x2 +x3
Subject to:
15 x1+15.8x2 < 150
5x1+6.4x2+15x3 < 77
2.8x2+11.8x3 < 36
x1, x2, x3 > 0
The optimal tableau for this solution is:
Cj 5 4.5 1 0 0 0
SV X1 X2 X3 S1 S2 S3 Q
5 X1 1 1.053 0 0.067 0 0 10
1 X3 0 0.67 1 -0.022 0.067 0 1.8
0 S3 0 1.924 0 0.258 -0.773 1 15.12
Zj 5 5.342 1 0.311 0.067 0 51.8
C j - Zj 0 -0.842 0 -0.311 -0.067 0
Determine the range of optimality for the coefficients of the basic-decision variables.
Solution:
Analysis of basic decision variables
The analysis will be conducted on products on X1 and X3 which are in the basic solution. Divide
each Cj - Zj row entry for variables not in the solution (for instance, by X2, S1 and S2 values) by
the associated variable aij from X1or X3 row.
X2 S1 S2
Cj - Zj row -0.842 -0.311 -0.067 Non-basic variables
Steps:
a. Take the Cj - Zj row of the optimal solution of the non-basic variables
b. Take the X1 row of the non-basic variables
c. Cj - Zj row
X1 row
❖ Upper Limit
The smallest positive number in the Cj - Zj row tells how much the profit
X1
of X1 can be increased before the solution is changed.
Upper Limit= Cj (for X1) +the smallest positive value of Cj - Zj row
=5+∞=∞ X1 row
Note: Cj (for X1) =5(Look in the OF of the LP problem)
❖ Lower Limit
The largest negative number closest (negative amount closest to 0)
Lower Limit= Cj (for X1) +The largest negative value of Cj - Zj row
=5+ (-0.8) = 4.2 X1 row
Therefore, the range of optimality for the coefficient of X1 is 4.2< Cj (for X1) < ∞ (The coefficient
of X1 in the objective function can change between 4.2 and ∞ without changing the optimal
solution mix X1=10, X3=1.8 and S3=15.12)
II. Analysis of X2
X2 S1 S2
Non-basic variables
Cj - Zj row -0.842 -0.311 -0.067
X3 row 0.67 -0.022 0.067
Cj - Zj row
-1.26 14.13 -1
X1 row
Therefore, the range of optimality for the coefficient of X3 is 0 < Cj (for X3) < 15.13 (The
coefficient of X3 in the objective function can change between 0 and 15.13 without changing
the optimal solution mix X1=10, X3=1.8 and S3=15.12). However, this change will change
only the optimal value of the objective function (i.e. MaxZ will change)
Exercise:
Max.Z=50x1 +120x2
Subject to:
2 x1+4x2 < 80
3x1+x2< 60
x1, x2 > 0
Determine the range of optimality for the coefficient of the basic variables.
Optimal Solution
Cj
SV X1 X2 S1 S2 Q
5 X1 1/2 1 1/4 0 20
1 S2 5/2 0 -1/4 1 40
Zj 60 120 30 0 $2,400
C j - Zj $-10 $0 $-30 $0
Ans: The range of optimality for X2’s profit coefficient is: $100 < Cj (for X2) < ∞
Cj (new)>Zj
The range of insignificance is the range over which Cj rates for non-basic variables can vary without
causing a change in the optimal solution mix (variable) is called the range of insignificance.
Example:
Max.Z=5x1 +4.5x2 +x3
❖ Shadow prices:
How much should a firm be willing to pay to make additional resources available?
Shadow prices signify the change in the optimal value of the objective function for 1 unit increases
in the value of the RHS of the constraint that represent the availability of scarce resources.
The negative of the number of Cj - Zj row in its slack variable columns provide as with shadow
prices. Or: shadow prices are found in the Zj row of the final simplex tableau in the slack variable
columns.
❖ RHS ranging is the range over which shadow prices remain valid.
Example:
C j - Zj 0 0 -0.714 -0.428 0
Required:
1. Determine the shadow price for each constraint
2. Determine the RHS ranges over which the shadow prices are valid
❖ Analysis of the 1st constraint (S1)
Q S1 Q/ S1
3.57 -0.143 -24.96
1.143 -0.286 -3.99
0.857 0.286 3.00
Q S3 Q/ S3
3.57 0 -
1.143 1 1.143
0.857 0 -