Professional Documents
Culture Documents
Introduction, Advantages of Linear Programming
Introduction, Advantages of Linear Programming
The technique of linear programming was formulated by a Russian mathematician L.V. Kantorovich. But the
present version of simplex method was developed by Geoge B. Dentzig in 1947. Linear programming (LP) is an
important technique of operations research developed for optimum utilization of resources.
It is an important optimization (maximization or minimization) technique used in decision making is business
and everyday life for obtaining the maximum or minimum values as required of a linear expression to satisfying
certain number of given linear restrictions.
• Decision Variables: The decision variables are the variables which will decide my output. They represent my
ultimate solution. To solve any problem, we first need to identify the decision variables. For the above example,
the total number of units for A and B denoted by X & Y respectively are my decision variables.
• Objective Function: It is defined as the objective of making decisions. In the above example, the company
wishes to increase the total profit represented by Z. So, profit is my objective function.
• Constraints: The constraints are the restrictions or limitations on the decision variables. They usually limit the
value of the decision variables. In the above example, the limit on the availability of resources Milk and Choco
are my constraints.
• Non-negativity restriction: For all linear programs, the decision variables should always take non-negative
values. Which means the values for decision variables should be greater than or equal to 0.
Characteristics:
(a) Objective function:
There must be clearly defined objective which can be stated in quantitative way. In business problems the
objective is generally profit maximization or cost minimization.
(b) Constraints:
All constraints (limitations) regarding resources should be fully spelt out in mathematical form.
(c) Non-negativity:
The value of variables must be zero or positive and not negative. For example, in the case of production, the
manager can decide about any particular product number in positive or minimum zero, not the negative.
(d) Linearity:
The relationships between variables must be linear. Linear means proportional relationship between two ‘or
more variable, i.e., the degree of variables should be maximum one.
(e) Finiteness:
The number of inputs and outputs need to be finite. In the case of infinite factors, to compute feasible solution is
not possible.
Assumptions:
(iii) The relationship between objective function and constraints are linear.
(iv) The objective function is to be optimized i.e., profit maximization or cost minimization.
This problem can be converted into linear programming problem to determine how many units of each product
should be produced per week to have the maximum profit. Firstly, the objective function is to be formulated.
Suppose x1 and x2 are units produced per week of product A and B respectively. The sale of product A and
product B yields Rs 35 and Rs 40 respectively. The total profit will be equal to
Since the raw material and labor is in limited supply the mathematical relationship that explains this limitation
is called inequality. Therefore, the inequality equations will be as follows:
Product A requires 4 kg of raw material and product B also requires 4 Kg of Raw material; thus, total
consumption is 4x1+4x2, which cannot exceed the total availability of 60 kg. Thus, this constraint can be
expressed as:
4x1 + 4x2 ≤ 60
6x1 + 5x2 ≤ 90
Where 6 hours and 5hours of labor is required for the production of each unit of product A and B respectively,
but cannot exceed the total availability of 90 hours.
Subject to:
Note: It is to be noted that “≤” (less than equal to) sign is used as the profit maximizing output may not fully
utilize all the resources, and some may be left unused. And the non-negativity condition is used since the x1 and
x2 are a number of units produced and cannot have negative values.
Minimization Case
The minimization case can be well understood through a problem. Let’s say; the agricultural research institute
recommended a farmer to spread out at least 5000 kg of phosphate fertilizer and not less than 7000 kg of
nitrogen fertilizer to raise the productivity of his crops on the farm. There are two mixtures A and B, weighs
100 kg each, from which these fertilizers can be obtained.
The cost of each Mixture A and B is Rs 40 and 25 respectively. Mixture A contains 40 kg of phosphate and 60
kg of nitrogen while the Mixture B contains 60 kg of phosphate and 40 kg of nitrogen. This problem can be
represented as a linear programming problem to find out how many bags of each type a farmer should buy to
get the desired amount of fertilizers at the minimum cost.
Firstly, the objective function is to be formulated. Suppose, x 1 and x2are the number of bags of mixture A and
mixture B. The cost of both the mixture is 40x1 + 25x2 and thus, the objective function will be:
Minimize
Z = 40x1+25x2
In this problem, there are two constraints, minimum 5000 kg of phosphate and minimum 7000 kg of nitrogen is
required. The Bag A contains 40 kg of phosphate while Bag B contains 60 kg of phosphate. Thus, the phosphate
constraint can be expressed as:
Where, Bag A contains 60 kg of nitrogen and Bag B contains 40 kg of nitrogen, and the minimum requirement
of nitrogen is 7000 kg.
Thus, the linear programming problem is:
Subject to:
Note: It is to be noted that, “≥” (greater than equal to) sign shows the full utilization of resources at the
minimum cost. The non-negativity condition is used, since x1 and x2 represent the number of bags of both the
mixture and hence cannot have the negative values.
Exercise #1: A workshop has three (3) types of machines A, B and C; it can manufacture two (2) products 1
and 2, and all products have to go to each machine and each one goes in the same order; First to the machine A,
then to B and then to C. The following table shows:
Formulate and solve using the graphical method a Linear Programming model for the previous situation that
allows the workshop to obtain maximum gains.
Decision Variables:
Objective Function:
Maximize2
Constraints:
The constraints represent the number of hours available weekly for machines A, B and C, respectively, and also
incorporate the non-negativity conditions.
For the graphical solution of this model we will use the Graphic Linear Optimizer (GLP) software. The green
colored area corresponds to the set of feasible solutions and the level curve of the objective function that passes
by the optimal vertex is shown with a red dotted line.
The optimal solution is and with an optimal value that represents the workshop’s profit.
Simplex Method
The Simplex Method or Simplex Algorithm is used for calculating the optimal solution to the linear
programming problem. In other words, the simplex algorithm is an iterative procedure carried systematically to
determine the optimal solution from the set of feasible solutions.
Firstly, to apply the simplex method, appropriate variables are introduced in the linear programming problem,
and the primary or the decision variables are equated to zero. The iterative process begins by assigning values to
these defined variables. The value of decision variables is taken as zero since the evaluation in terms of the
graphical approach begins with the origin. Therefore, x1 and x2 is equal to zero.
The decision maker will enter appropriate values of the variables in the problem and find out the variable value
that contributes maximum to the objective function and removes those values which give undesirable results.
Thus, the value of the objective function gets improved through this method. This procedure of substitution of
variable value continues until any further improvement in the value of the objective function is possible.
Following two conditions need to be met before applying the simplex method:
1. The right-hand side of each constraint inequality should be non-negative. In case, any linear programming
problem has a negative resource value, then it should be converted into positive value by multiplying both the
sides of constraint inequality by “-1”.
2. The decision variables in the linear programming problem should be non-negative.
Thus, the simplex algorithm is efficient since it considers few feasible solutions, provided by the corner points,
to determine the optimal solution to the linear programming problem.
Here origin means the place where the product is originated or manufactured for the ultimate sales while the
places where the product is required to be sold is called destination. For solving the transportation problem, the
following steps are to be systematically followed:
1. Obtaining the initial feasible solution, which means identifying the solution that satisfies the requirements of
demand and supply. There are several methods through which the initial feasible solution can be obtained; these
are:
• North-West Corner
• Least Cost Method
• Vogel’s Approximation Method
Note: It is to be ensured that the number of cells occupied should be equal to m+n-1, where “m” is the number
of rows while “n” is the number of columns.
2. Testing the optimality of the initial feasible solution. Once the feasible solution is obtained, the next step is to
check whether it is optimum or not. There are two methods used for testing the optimality:
• Stepping-stone Method
• Modified Distribution Method (MODI)
The final step is to revise the solution until the optimum solution is obtained.
i) maximize the profit of transporting “n” units of product to the destination “y”
ii) Minimize the cost of shipping “n” units of product to the destination “y”.
The prerequisite condition for solving the transportation problem is that demand should be equal to the supply.
In case the demand is more than supply, then dummy origin is added to the table. The supply of dummy origin
will be equal to the difference between the total supply and total demand. The cost associated with the dummy
origin will be zero.
Similarly, in case the supply is more than the demand, then dummy source is created whose demand will be
equivalent to the difference between supply and demand. Again the cost associated with the dummy source will
be zero.
Once the demand and supply are equal, the following procedure is followed:
1. Select the north-west or extreme left corner of the matrix, assign as many units as possible to cell AD, within
the supply and demand constraints. Such as 20 units are assigned to the first cell, that satisfies the demand of
destination D while the supply is in surplus.
2. Now move horizontally and assign 30 units to the cell AE. Since 30 units are available with the source A, the
supply gets fully saturated.
3. Now move vertically in the matrix and assign 40 units to Cell BE. The supply of source B also gets fully
saturated.
4. Again move vertically, and assign 25 units to cell CE, the demand of destination E is fulfilled.
5. Move horizontally in the matrix and assign 35 units to cell CF, both the demand and supply of origin and
destination gets saturated. Now the total cost can be computed.
The Total cost can be computed by multiplying the units assigned to each cell with the concerned transportation
cost. Therefore,
The following is the flow chart showing the steps involved in solving the transportation problem using the
Vogel’s Approximation Method:
The concept of Vogel’s Approximation Method can be well understood through an illustration given below:
1. First of all the difference between two least cost cells are calculated for each row and column, which can be
seen in the iteration given for each row and column. Then the largest difference is selected, which is 4 in this
case. So, allocate 20 units to cell BD, since the minimum cost is to be chosen for the allocation. Now, only 20
units are left with the source B.
2. Column D is deleted, again the difference between the least cost cells is calculated for each row and
column, as seen in the iteration below. The largest difference value comes to be 3, so allocate 35 units to cell
AF and 15 units to the cell AE. With this, the Supply and demand of source A and origin F gets saturated, so
delete both the row A and Column F.
3. Now, single column E is left, since no difference can be found out, so allocate 60 units to the cell CE and 20
units to cell BE, as only 20 units are left with source B. Hence the demand and supply are completely met.
Now the total cost can be computed, by multiplying the units assigned to each cell with the cost concerned.
Therefore,
Note: Vogel’s Approximation Method is also called as Penalty Method because the difference costs chosen are
nothing but the penalties of not choosing the least cost routes.
If modified distribution method (MODI) is applied to test for optimality, it will not be possible to find all the
variables ui and vj since the number of allocated cells and their corresponding cij values is not enough.
3. Next step is to calculate the opportunity cost of the unoccupied cells (AF, BD, BF, CD) by using the
following formula
Cij – (ui+Vi)
4. Choose the largest positive opportunity cost, which is 7 and draw a closed path, as shown in the matrix
below. Start from the unoccupied cell and assign “+” or “–“sign alternatively. Therefore, The most favored cell
is BD, assign as many units as possible.
5. The matrix below shows the maximum allocation to the cell BD, and that number of units are added to the
cell with a positive sign and subtracted from the cell with a negative sign.
6. Again, repeat the steps from 1 to 4 i.e. find out the opportunity costs for each unoccupied cell and assign
the maximum possible units to the cell having the largest opportunity cost. This process will go on until the
optimum solution is reached.
The Modified distribution method is an improvement over the stepping stone method since; it can be applied
more efficiently when a large number of sources and destinations are involved, which becomes quite difficult or
tedious in case of stepping stone method.
Modified distribution method reduces the number of steps involved in the evaluation of empty cells, thereby
minimizes the complexity and gives a straightforward computational scheme through which the opportunity
cost of each empty cell can be determined.
In a factory, a supervisor may have six workers available and six jobs to fire. He will have to take decision
regarding which job should be given to which worker. Problem forms one to one basis. This is an assignment
problem.
1. Assignment Model:
Suppose there are n facilitates and n jobs it is clear that in this case, there will be n assignments. Each facility or
say worker can perform each job, one at a time. But there should be certain procedure by which assignment
should be made so that the profit is maximized or the cost or time is minimized.
In the table, Coij is defined as the cost when jth job is assigned to ith worker. It maybe noted here that this is a
special case of transportation problem when the number of rows is equal to number of columns.
Mathematical Formulation:
Any basic feasible solution of an Assignment problem consists (2n – 1) variables of which the (n – 1) variables
are zero, n is number of jobs or number of facilities. Due to this high degeneracy, if we solve the problem by
usual transportation method, it will be a complex and time consuming work. Thus a separate technique is
derived for it. Before going to the absolute method it is very important to formulate the problem.
Now as the problem forms one to one basis or one job is to be assigned to one facility or machine.
Subjected to constraints
and xij is either zero or one.
Consider the objective function of minimization type. Following steps are involved in solving this Assignment
problem,
1. Locate the smallest cost element in each row of the given cost table starting with the first row. Now, this
smallest element is subtracted form each element of that row. So, we will be getting at least one zero in each
row of this new table.
2. Having constructed the table (as by step-1) take the columns of the table. Starting from first column locate the
smallest cost element in each column. Now subtract this smallest element from each element of that column.
Having performed the step 1 and step 2, we will be getting at least one zero in each column in the reduced cost
table.
3. Now, the assignments are made for the reduced table in following manner.
(i) Rows are examined successively, until the row with exactly single (one) zero is found. Assignment is made
to this single zero by putting square □ around it and in the corresponding column, all other zeros are crossed out
(x) because these will not be used to make any other assignment in this column. Step is conducted for each row.
(ii) Step 3 (i) in now performed on the columns as follow:- columns are examined successively till a column
with exactly one zero is found. Now , assignment is made to this single zero by putting the square around it and
at the same time, all other zeros in the corresponding rows are crossed out (x) step is conducted for each
column.
(iii) Step 3, (i) and 3 (ii) are repeated till all the zeros are either marked or crossed out. Now, if the number of
marked zeros or the assignments made are equal to number of rows or columns, optimum solution has been
achieved. There will be exactly single assignment in each or columns without any assignment. In this case, we
will go to step 4.
4. At this stage, draw the minimum number of lines (horizontal and vertical) necessary to cover all zeros in the
matrix obtained in step 3, Following procedure is adopted:
(i) Tick mark () all rows that do not have any assignment.
(ii) Now tick mark() all these columns that have zero in the tick marked rows.
(iii) Now tick mark all the rows that are not already marked and that have assignment in the marked columns.
(iv) All the steps i.e. (4(i), 4(ii), 4(iii) are repeated until no more rows or columns can be marked.
(v) Now draw straight lines which pass through all the un marked rows and marked columns. It can also be
noticed that in an n x n matrix, always less than ‘n’ lines will cover all the zeros if there is no solution among
them.
5. In step 4, if the number of lines drawn are equal to n or the number of rows, then it is the optimum solution if
not, then go to step 6.
6. Select the smallest element among all the uncovered elements. Now, this element is subtracted from all the
uncovered elements and added to the element which lies at the intersection of two lines. This is the matrix for
fresh assignments.
7. Repeat the procedure from step (3) until the number of assignments becomes equal to the number of rows or
number of columns.
Example : A marketing manager has five salesmen and sales districts. Considering the capabilities of the
salesmen and the nature of districts, the marketing manager estimates that sales per month (in hundred rupees)
for each salesman in each district would be as follows. Find the assignment of salesmen to districts that will
result in maximum sales.
Maximization Problem
Maximization assignment problem is transformed into minimization problem by
Solution: The given maximization problem is converted into minimization problem by subtracting from the
highest sales value (i.e., 41) with all elements of the given table.
Select the least uncovered element, i.e., 4 and subtract it from other uncovered elements, add it to the elements
at intersection of line and leave the elements that are covered with single line unchanged, Table.
Therefore,
Assignment Problem
Solution: Convert the 4 × 5 matrix into a square matrix by adding a dummy row D5.
Column-wise reduction is not necessary since all columns contain a single zero. Now, draw minimum number
of lines to cover all the zeros, as shown in Table.
Example : In a plant layout, four different machines M1, M2, M3 and M4 are to be erected in a machine shop.
There are five vacant areas A, B, C, D and E. Because of limited space, Machine M2 cannot be erected at area
C and Machine M4 cannot be erected at area A. The cost of erection of machines is given in the Table.
Assignment Problem
Find the optimal assignment plan.
Solution: As the given matrix is not balanced, add a dummy row D5 with zero cost values. Assign a high cost
H for (M2, C) and (M4, A). While selecting the lowest cost element neglect the high cost assigned H, as shown
in Table below.
Number of lines drawn ≠ Order of matrix. Hence not Optimal. Select the smallest uncovered element, in this
case 1. Subtract 1 from all other uncovered element and add 1 with the elements at the intersection. The element
covered by single line remains unchanged. These changes are shown in Table. Now try to draw minimum
number of lines to cover all the zeros.
Optimal Assignment