Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

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.

Common terminologies used in Linear Programming

• 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.

Advantages of Linear Programming


1. LP makes logical thinking and provides better insight into business problems.
2. Manager can select the best solution with the help of LP by evaluating the cost and profit of various
alternatives.
3. LP provides an information base for optimum allocation of scarce resources.
4. LP assists in making adjustments according to changing conditions.
5. LP helps in solving multi-dimensional problems.

Assumptions:

(i) There are a number of constraints or restrictions- expressible in quantitative terms.

(ii) The prices of input and output both are constant.

(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.

Mathematical formulations of LP Models


for Product-Mix Problems
Maximization Case
Let’s understand the maximization case with the help of a problem. Suppose a firm produces two products A
and B. For producing the each unit of product A, 4 Kg of Raw material and 6 labor hours are required. While,
for the production of each unit of product B, 4 kg of raw material and 5 labor hours is required. The total
availability of raw material and labor hours is 60 Kg and 90 Hours respectively (per week). The unit price of
Product A is Rs 35 and of product, B is Rs 40.

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

Z = 35x1+ 40x2 (objective function)

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

Similarly, the second constraint equation will be:

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.

Thus, the linear programming problem will be:

Maximize Z = 35x1+ 40x2 (profit)

Subject to:

4x1 + 4x2 ≤ 60 (raw material constraint)


6x1 + 5x2 ≤ 90 (labor hours constraint)
x1, x2 ≥ 0 (Non-negativity restriction)

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:

40x1 + 60x2 ≥ 5000

Similarly, the second constraint equation can be expressed as:

60x1 + 40x2 ≥ 7000

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:

Minimize Z = 40x1+25x2 (cost)

Subject to:

40x1 + 60x2 ≥ 5000 (Phosphate Constraint)


60x1 + 40x2 ≥ 7000 (Nitrogen Constraint)
x1, x2 ≥ 0 (Non-negativity Restriction)

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.

Graphical and Simplex Method of Solving


LP problems
The Graphical Method (graphic solving) is an excellent alternative for the representation and solving of
Linear Programming models that have two decision variables.

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:

• The hours needed at each machine, per product unit


• The total available hours for each machine, per week
• The profit of each product per unit sold

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:

• : Product 1 Units to be produced weekly


• : Product 2 Units to be produced weekly

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.

General Structure of Transportation Problem


The Transportation Method of linear programming is applied to the problems related to the study of the
efficient transportation routes i.e. how efficiently the product from different sources of production is transported
to the different destinations, such as the total transportation cost is minimum.

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.

The two most common objectives of transportation problem could be:

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”.

North West Corner Method


The North-West Corner Rule is a method adopted to compute the initial feasible solution of the transportation
problem. The name North-west corner is given to this method because the basic variables are selected from the
extreme left corner.
The concept of North-West Corner can be well understood through a transportation problem given below:
In the table, three sources A, B and C with the production capacity of 50 units, 40 units, 60 units of product
respectively is given. Every day the demand of three retailers D, E, F is to be furnished with at least 20 units, 95
units and 35 units of product respectively. The transportation costs are also given in the matrix.

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,

Total Cost = 20*5+ 30*8+ 40*6+ 25*9+ 35*6 = Rs 1015

Vogel’s Approximation Method


AKTUTHEINTACTONE4 MAR 2019 3 COMMENTS
The Vogel’s Approximation Method or VAM is an iterative procedure calculated to find out the initial
feasible solution of the transportation problem. Like Least cost Method, here also the shipping cost is taken into
consideration, but in a relative sense.

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,

Total Cost = 20*3 + 35*1 + 15*4 + 60*4 + 20*8 = Rs 555

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.

Degeneracy in Transportation Problem


If the basic feasible solution of a transportation problem with m origins and n destinations has fewer than m + n
– 1 positive xij (occupied cells), the problem is said to be a degenerate transportation problem. Degeneracy can
occur at two stages:

1. At the initial solution


2. During the testing of the optimal solution

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.

Consider the following example:

The initial basic feasible solution (by north-west rule) is:


No. of factories (origins) m = 3, no. of dealers (destinations) n = 4

So m + n – 1 = 3 + 4 – 1 = 6. But no. of allocations = 5.

So the solution is degenerate.

Modified Distribution Method


(MODI Mothed)
The Modified Distribution Method or MODI is an efficient method of checking the optimality of the initial
feasible solution.
The concept of MODI can be further comprehended through an illustration given below:

1. Initial basic feasible solution is given below

2. Now, calculate the values of ui and vj by using the equation


ui+vj = Cij
Substituting the value of u1 as 0
U1+V1 = C11, 0+V1 = 6 or V1 = 6
U1 +V2 = C12, 0+V2 = 4 or V2 = 4
U2+V2 = C22, U2+4 = 8 or U2 = 4
U3+ V2 = C32, U3+4 = 4 or U3 = 0
U3+V3 = C33, 0+V3 = 2 or V3 =2

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)

AF = C13 – (U1+V3), 1- (0+2) = -1 or 1


BD = C21 – (U2+v1), 3- (4+6) = -7 or 7
BF = C23 – (U2+V3), 7- (4+2) = 1 or -1
CD = C31- (U3+V1), 4- (0+6) = -2 or 2

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.

Assignment Model: Hungarian Algorithm


and its Applications
AKTUTHEINTACTONE4 MAR 2019 3 COMMENTS
Assignment Problem is a special type of linear programming problem which deals with the allocation of the
various resources to the various activities on one to one basis. It does it in such a way that the cost or time
involved in the process is minimum and profit or sale is maximum. Though there problems can be solved by
simplex method or by transportation method but assignment model gives a simpler approach for these problems.

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.

Suppose xjj is a variable which is defined as

1 if the ith job is assigned to jth machine or facility

0 if the ith job is not assigned to jth machine or facility.

Now as the problem forms one to one basis or one job is to be assigned to one facility or machine.

The total assignment cost will be given by

The above definition can be developed into mathematical model as follows:

Determine xij > 0 (i, j = 1,2, 3…n) in order to

Subjected to constraints
and xij is either zero or one.

Method to solve Problem (Hungarian Technique):

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.

Maximization Assignment Problem


There are problems where certain facilities have to be assigned to a number of jobs so as to maximize the
overall performance of the assignment. The problem can be converted into a minimization problem in the
following ways and then Hungarian method can be used for its solution.

1. Change the signs of all values given in the table.


2. Select the highest element in the entire assignment table and subtract all the elements of the table from the highest
element.

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.

Conversion to Minimization Problem

Reduce the matrix row-wise

Matrix Reduced Row-wise


Reduce the matrix column-wise and draw minimum number of lines to cover all the zeros in the matrix, as
shown in Table.

Matrix Reduced Column-wise and Zeros Covered

Number of lines drawn ≠ Order of matrix. Hence not optimal.

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.

Added & Subtracted the least Uncovered Element


Now, number of lines drawn = Order of matrix, hence optimality is reached. There are two alternative
assignments due to presence of zero elements in cells (4, C), (4, D), (5, C) and (5, D).

Two Alternative Assignments

Therefore,

Unbalanced Assignment Problems


Whenever the cost matrix of an assignment problem is not a square matrix, that is, whenever the number of
sources is not equal to the number of destinations, the assignment problem is called an unbalanced assignment
problem. In such problems, dummy rows (or columns) are added in the matrix so as to complete it to form a
square matrix. The dummy rows or columns will contain all costs elements as zeroes. The Hungarian method
may be used to solve the problem.
Example : A company has five machines that are used for four jobs. Each job can be assigned to one and only
one machine. The cost of each job on each machine is given in the following Table.

Unbalanced Maximization Assignment problem example

Assignment Problem

Solution: Convert the 4 × 5 matrix into a square matrix by adding a dummy row D5.

Dummy Row D5 Added


Row-wise Reduction of the Matrix

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.

All Zeros in the Matrix Covered

Number of lines drawn ≠ Order of matrix. Hence not optimal.


Select the least uncovered element, i.e., 1, subtract it from other uncovered elements, add to the elements at
intersection of lines and leave the elements that are covered with single line unchanged as shown in Table.

Subtracted or Added to Elements

Number of lines drawn ≠ Order of matrix. Hence not optimal.

Again Added or Subtracted 1 from Elements


Number of lines drawn = Order of matrix. Hence optimality is reached. Now assign the jobs to machines, as
shown in Table.

Assigning Jobs to Machines

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.

Dummy Row D5 Added

– Row-wise reduction of the matrix is shown in Table.

Matrix Reduced Row-wise


Note: Column-wise reduction is not necessary, as each column has at least one single zero. Now, draw
minimum number of lines to cover all the zeros, see Table.

Lines Drawn to Cover all Zeros

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.

Added or Subtracted 1 from Elements


Now number of lines drawn = Order of matrix, hence optimality is reached. Optimal assignment of machines to
areas are shown in Table.

Optimal Assignment

Hence, the optimal solution is:

You might also like