Вы находитесь на странице: 1из 155

Unit-3

Formulation of the transportation problem


Problem formulation
Problem refined
Problem more refined.
This is called balanced transportation problem as it has only equations and
the unbalanced original problem has inequalities
We shall solve transportation problem now. It has two stages
1. Identify a basic feasible solution

Three ways to achieve this


A. Northwest Corner Rule
B. Minimum Cost Method
C. Penalty Cost Method (Vogel’s Approximation Method-VAM)

2. Get the optimal solution

Two ways to achieve this


A. Stepping Stone Method
B. MODI (Modified Distribution) method or UV Method

Procedure to solve transportation problem:


First get basic feasible solution and then optimize this
If we get a good basic feasible solution then the iterations required to optimize this
become lesser.
Representation of a transportation problem in a very convenient manner.
Following 3 rows and 4 columns matrix represents 3 supply points and 4
destination points. i.e. supplies here are 40, 60, 50 (ai)and demands are 20, 30, 50,
50 (bj).
As supply equals demand, therefore this is a balanced transportation problem.
The unit cost of transportation Cij (from I to j) is written as follows.
Northwest Corner Rule
Now, lets try to get a good basic feasible solution to this problem.
So, all the supplies are demands are met and we have got a basic feasible solution.
The cost of transportation will be:
(4*20)+(6*20)+(8*10)+(6*50)+(8*50) = 80+120+80+300+400 = 980
Hence, using NWC, our objective function value is 980
Minimum Cost Method
Look at the minimum cost now and start allocation from there.
We see that minimum cost is 4, so we start from extreme top left corner
Now there is tie between 6 (three 6s are available.) Choose any …arbitrarily
Now again look at the minimum cost. Now, we see that there is only one 6
Now again look at the minimum cost. Now, we see that there are two 7s. Break
the tie arbitrarily
Now we are left with only one 7. Allocate this now
Now last step
So, all the supplies are demands are met and we have got a basic feasible solution.
The cost of transportation will be:
(4*20)+(6*20)+(7*10)+(6*50)+(7*10)+(8*40) = 80+120+70+300+70+320 = 960
Hence, using minimum cost method, our objective function value is 960
Also note that there were 5 allocations in the NWC whereas there are 6 allocations in
Minimum Cost Method
Penalty Cost Method/ Vogel’s Approximation Method
Now, lets look at the third method i.e. Penalty cost method (Vogel’s approximation
method)
Now look at the first row, Because our objective is to minimize the cost. So, we want to
allocate all 40 supplies at the cost of minimum cost i.e.4.
And, because of any reason, if we are not able to do it, it means there will be some
penalty…..meaning that value of objective function will increase.
So, the penalty that we will incur per unit for not being able to allocate than how much
penalty will be there?
It will be equal to the difference between the least and the next least. In our problem
the least is 4 and the next least is 6. So, the penalty will be 2 associated with first row.
In the second row, the penalty will be zero because there are two positions with the
same minimum cost.
In the third row, the difference between the least and the next least is 1, so the penalty
will be 1
Now. Look at columns.
In the first column, if I am not able to allocate 20 in the least cost (i.e. 4), then, the
difference between the least and the next least is 1 (5-4) , so the penalty will be 1 in the
first column
Similarly, penalties will be 1, 0, 1 in 2nd, 3rd and 4th columns respectively
Now, find out the maximum penalty.
So the first row is very impt. as it is having maximum penalty.
So, in this row, I shall try to put as much as possible in the least cost position because by
not putting in the least cost position, I will incur maximum penalty.
This is done as shown below:
Now, compute the penalties once again. The problem will look like this:
Now, once again, we see that row one has maximum penalty. Therefore go to this row
and allocate as much as possible in the minimum position.
It will look like this:
Now, compute the penalties once again. The problem will look like this (Just like the
previous slide):
Now, we see that maximum penalty is 1 in rows and columns. There is a tie for the max.
penalty. The tie will be broken arbitrarily.
So, we shall look at 2nd column and break the tie
It will look like this:
Now, compute the penalties once again. The problem will look like this :
We see that max. penalty is 2 in the 3rd row. So. Allocate as much as possible in the
minimum cost position
Now, the last step
We see that this method also has 6 allocations just like minimum cost method.
Cost can be calculated as:
(4*20)+(6*20)+(7*10)+(6*10)+(6*40)+(7*50) = 80+120+70+60+240+350 = 920
So, we see that Vogel’s approx. method (VAM) give us the minimum cost i.e. 920.

Here, it is important to note that in the minimum cost method and Vogel’s approx.
method, we have broken the tie arbitrarily. If we choose some other option than we
have chosen here, the answer will vary.
It may also be noted that all three methods are only giving us a starting feasible
solutions (which is a good solution) but these are not optimal.
Why?
Because, at the end, we see that we don’t have any option and we have to make
allocations in the vacant boxes. Therefore, we have no control at the decisions at that
time.
So, the solutions reached here are not optimal
Lets try to understand what is a basic feasible solution to the transportation problem.

Here, m+n means adding supply and delivery points, which is 3+4 = 7 in our case
If we analyse all the three solutions, we shall find that they fulfill 1st, 2nd and 4th criteria
of basic feasible solution.
What is 3rd criteria i.e. loop.
Lets discuss about it now:

Assume that allocations are made like this. It is forming a loop here as shown in next slide
This solution satisfies all the conditions of basic feasible solution but does not satisfy 3rd
condition. It is forming a loop here as shown
A loop shows some kind of dependency between the allocations. It means that these
allocations are not independent. Now, we have to break this loop.
We try to break this loop by decreasing number of allocations in the extreme left box. But
we see that it increases the cost by 1 unit
As we try to increase the allocations in minimum cost position, we see that cost comes
down by 1 unit
So, we go on increasing the allocation in minimum cost position and see that we get
the following solution which is basic feasible solution. This is called basic feasible
solution as it fulfills all the four conditions as discussed earlier.
Next, if we see that we have less than (m+n-1) allocations, we say that we have
degenerate basic feasible solution.
Note that if we get a degenerate basic feasible solution with exactly (m+n-1) solution,
it is extremely desirable.
If we get a degenerate basic feasible solution with less than (m+n-1) allocations than,
we need to add an epsilon (Ɛ) suitably to make it basic feasible
Also, we can use any other arbitrary method to solve this allocation problem. But we
need to make sure that the number of allocations are less than (m+n-1). Because if the
number of allocations are more than this, the, there is definitely a loop…..which has to
be broken. Even if the allocations are equal to (m+n-1), still there can be a hidden
loop. We need to check that and if there is a loop…break it and degenerate.
Preferably we use minimum cost method or VAM as both give us basic feasible
solution without loop.
For example, A degenerate basic feasible solution with a loop
Loop visible here
A degenerate basic feasible solution with a loop
What is degenerate:
When we have a feasible solution with no loop and with less than (m+n-1) allocations, it
satisfies all the supply/demand conditions, then it is a degenerate basic feasible
solution. So, whenever we have a degenerate basic feasible solution, it is necessary for
us to introduce an epsilon (Ɛ) in such a way that it does not form a loop.
NWC, Min. Cost and VAM will never give us a loop because of the way the allocations
are made. As whenever we allocated we tried to put the maximum which is the
minimum of the supply/demand and because we put the maximum in that position
there will not be any loop with solutions to all these three methods.
So, we say that to get a basic feasible solution there should not be any loop as it
happened with all the three methods. A basic feasible solution is also characterized by
(m+n-1) independent allocations. Sometimes we get a basic feasible solution with these
three methods with less than (m+n-1) allocations, that means we have a degenerate
solution.
Transportation problem-Optimal Solutions

Two methods to get optimal solutions from basic feasible solution:


1. Stepping stone method
2. Modified Distribution method (MODI) or UV method
Stepping Stone method

Example:
We start with a basic feasible solution which we obtained using minimum cost
method or VAM
The cost corresponding to this is 80+120+300+70+70+320 = 960
So, now, from this basic feasible solution, we would go to optimal solution
So, first of all, we shall check whether this is optimal
If this is not optimal it means that one of the unallocated positions will get allocation.
So, we will look at all the unallocated positions or non basic positions.
The allocated positions have variables called basic variables and unallocated have
non basic variables.
So, the non basic variables in this previous slide are: X13, X14, X21, X22, X31, X33
Now, we try to put 1 allocation in X13. If we do this, it means we are exceeding (m+n-
1) allocations. It means it will make a loop as shown here.
Now, balance the allocations as supply and demand should remain same.

So, the net effect of this will be +8-6+7-8+7-6 = 2.


It means if we allocate in X13, the net increase is 2
Now, we try to allocate in the X14 position. It will form a loop as shown below:
Now, balance the supply and demand as shown below:

So, the net effect of this will be +8-8+7-6 = 1.


It means if we allocate in X14, the net increase is 1
Now, we try to allocate in the X21 position. It will form a loop as shown below:
Now, balance the supply and demand as shown below:

So, the net effect of this will be +6-4+6-7+8-7 = 2.


It means if we allocate in X21, the net increase is 2
Now, we try to allocate in the X22 position. It will form a loop as shown below:
Now, balance the supply and demand as shown below:

So, the net effect of this will be +8-7+8-7 = 2.


It means if we allocate in X22, the net increase is 2
Now, we try to allocate in the X31 position. It will form a loop as shown below.
Also supply and demands have been balanced here:

So, the net effect of this will be +5-7+6-4 = 0


It means if we allocate in X31, the net increase/decrease is 0
Now, we try to allocate in the X33 position. Putting +1 here will form a loop as
shown below. Also supply and demands have been balanced here:

So, the net effect of this will be +6-8+7-6 = -1


It means if we allocate in X33, the net decrease is -1
So, we have tried to enter 6 non basic positions and we realize that there is a
decrease in cost only one position i.e. X33.
So, we shall try to put as much as we can in this position so that we gain as
much as we can.
We try to enter a Ɵ here instead of 1 and then we complete the loop. It will
look like this:
We want Ɵ to be as large as possible, when we try to do this we see that boxes
having – Ɵ will decrease and the box having +Ɵ increase.
For example, we increase Ɵ to 40, then box X34 will have zero allocation.
So, it means that maximum value that Ɵ can have is 40.
So, putting Ɵ equal to 40 will make the problem look like this

So, this is the next basic feasible solution and for this solution, the cost will be
80+100+60+350+70+240 = 920
Next, we shall whether this solution is optimal or not by going thru one more iteration.
To do that we shall now put +1 in all the six non basic positions in the previous solution
(shown below) and we shall see the effect of that:
We start by putting +1 in X13 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +8-6+7-6 = 3


It means if we allocate in X13, the net increase is 3
We start by putting +1 in X14 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +8-7+6-6 +7-6= 2


It means if we allocate in X14, the net increase is 2
We start by putting +1 in X21 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +6-4+6-7 +6-6= 1


It means if we allocate in X21, the net increase is 1
We start by putting +1 in X22 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +8-6+6-7= 1


It means if we allocate in X22, the net increase is 1
We start by putting +1 in X31 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +5-7+6-4= 0


It means if we allocate in X31, the net increase is 0
We start by putting +1 in X34 position, we shall check the loop, balance supply and
demand

So, the net effect of this will be +8-7+6-6= 1


It means if we allocate in X34, the net increase is 1
We see that in the six unallocated positions, putting +1 in each gives us an increase of
3,2,1,1,0,1 respectively.
None of them is capable of decreasing the objective function lower than 920 so we
realize that the optimum solution is reached.
However we realize that at the optimum one of the non basic variable (X31 position)
which can give us a zero increase or decrease at the optimum, this indicates alternate
optimum.
How to find alternate optimum?
Put Ɵ in X31 position than balance, X32 will become 10 - Ɵ, X12 will become 20+ Ɵ,
X11 will become 20- Ɵ as shown below:
Now, as we increase Ɵ, wee see that X11 and X32 is going to reduce and the limiting value
for Ɵ is 10 beyond which X32 will become negative.
So, Ɵ takes value 10 and the alternate optimum will look like this:

So, this is the alternate optimum given by stepping stone method.


Modified Distribution method (MODI) or UV method

Same problem as discussed for stepping stone method


We start with a basic feasible solution which we obtained using minimum cost
method or VAM. This has Z = 960
We associate u1 to u3 with supplies and v1 to v4 for demands and try to find their
values
For consistency, we start with u1=0 and now look at the first row. There is an
allocation in X11 and the associated cost is 4. Now, where ever there is allocation,
find out u or v whichever is to be found out such that ui+vJ = Cij. In this case, since ui
= 0 and Cij is 4, it means v1 = 4.
Similarly v2=6 (ui=0, Cij=6 so 0+6=6)
Now, come to X32 position. We see for this Cij=7 and u3=1 so, v2 = 7-1=6
Similarly for X34 position u3=1, Cij=8, so v4=8-1=7
Now go to X24 position . Already v4 is 7, Cij=7 so u2=0
Similarly, for X23 position, v2=6
Now, for all the unallocated 6 positions, find out Cij- (ui+vj)
It will be (2), (1) (2), (2), (0), (-1) for X13, X14, X21, X22, X31, X33 position
respectively.
Now, we have found out Cij- (ui+vj) which is just like Ci-Zj corresponding to every
non basic positions.
Now, look for negative Ci-Zj, it is X33 position, so the corresponding variable will
enter. Why negative? Because this is a minimization problem. For a maximization
problem, positive Ci-Zj will enter.
So, now, this variable enters. We indicate a Ɵ over here to indicate the extent of
entry i.e. to extent to which we can increase this variable.
To do that, we have to compute a loop. So this is the loop:
Next step, balance the allocations according to Ɵ

We see that as Ɵ increases, X23 and X34 decrease so the limiting value of Ɵ is 40
beyond which X34 will become negative
We again make this table to indicate the new basic feasible solution (take Ɵ as 40):
Cost associated with this: 920
With earlier solution this was 960.
So there is a gain of 40 and in linear programming the gain is a product of Ci-Zj and Ɵ
We had taken Ɵ as 40 and Cj-Zj was -1 (X33 position).
Multiply 40* (-1) is -40 hence we have cross checked that cost decreases by 40.
Now, we want to check whether this is optimal.
Using UV method, calculate u1 to u3 and v1 to v4 as previously discussed
Now, for all the unallocated 6 positions, find out Cij- (ui+vj)
It will be (3), (2) (1), (1), (0), (1) for X13, X14, X21, X22, X31, X34 position respectively.
We see that all are positive with one zero. There is no negative value. So there is no
entering variable so we say that the optimum solution is reached as all the Cij- (ui+vj) ≥ 0
For a minimization problem, positive Cij- (ui+vj) indicates optimality
Now, we see that one Cij- (ui+vj) is zero (X31 position).
It indicates alternate optimum. Lets find that.
Put a Ɵ in X31 position and form the loop,
Balance the allocations
Now, this will become a new solution which is this. This solution is same as
stepping stone method. This is called UV method or modified distribution method.

We can use any method but UV method or modified distribution method is


desirable as the problem size increases.
Assignment Problem

Example
A 4x4 problem
Let us assume that
1. every person can do these jobs
2. One person can be assigned only one job

Objective is to assign the jobs in such a manner that it results in minimum cost.
Such a problem is called assignment problem.
This type of formulation of problem is called standard assignment problem and is a
minimization problem
Let us look at some aspects of assignment problem
Aspect 1: It looks like a transportation problem but it is not. It is a square matrix
whereas in transportation it is not so.
So, we can consider assignment problem as a special case of transportation problem
where supply points are equal to the demand points i.e. m=n,
and ai = bj = 1
Procedure to solve:
Subtract the row minimum from each row to generate as many zero as possible,
The problem will look like this:
Subtract the column minimum from each column to generate as many zero as possible,
We see that in column 1, 3 and 4, the column minimum is zero. If we subtract zero from
all the elements, it will give us same values. So these columns will remain same. There
in only 2nd column which is not having zero. So we subtract column minimum from this
column
The problem will look like this:

Now, we have one zero in each row and each column. Now, we shall start making
assignments or allocations only at the points where there is zero.
So, we make 4 assignments, one in each row and one in each column. We see that this is
a feasible and optimal solution as we see that we have made our assignments only in zero
positions

It means
job 1 will go to person 3
job 2 will go to person 4
job 3 will go to person 2
job 4 will go to person 1
And the optimal cost will be 3+2+10+3 = 18 i.e. Z = 18
Rule to be followed in assigning:
If there is one assignable zero in any row or column, assign it.
If there are more than one assignable zeroes in a row or column, leave it and look
at it later.
This rule will give us as many assignments as possible.
If we don’t follow this rule in the previous slide, we may end up assigning three
jobs only because of the rule that one job goes to one person and one person can
be assigned only one job. The solution will be as shown below which is wrong:
Example 2: 5 jobs, 5 people
Procedure to solve:
Subtract the row minimum from each row to generate as many zero as possible,
The problem will look like this:
We realize that all columns have zero except 5th column .
So, we subtract the column minimum from the 5th to get a new reduced matrix
Now, we start making allocations.
First step:
Step2:

Now, we look at the third row. We see that there are two zeroes, so we leave it.
Then, we see that 4th and 5th row don’t have any assignable zero.
Now, we do the allocations column wise

Step1:

Now, we see that we are unable to proceed since there are no zeroes to allocate.
We see that we have only three assignments for this 5x5 matrix.
How to get 5 assignments?
How to get 5 assignments?
Procedure is as follows:
1. Tick the unassigned row
In these rows, tick the corresponding columns if there is a zero
Now, look at the tick marked column, if there is an assignment in that column, tick
mark at that corresponding row
The algorithm stops now since no more ticking is possible.
Now, draw lines through unticked rows and ticked columns
We see that we have covered all the zeroes.
We have followed this procedure:
Now, we reconstruct the matrix.
Find out the minimum value through which the line is not passing. We see in the
below mentioned that this number is 1

So, we take Ɵ = 1
This procedure has been followed in the previous slide.
Now, subtract Ɵ from all the numbers through which the line is not passing.
Add Ɵ to all the numbers that have two lines passing through them.
And keep the rest of them the same
This is shown below:
Now, start making assignments in the rows:
Step 1:

Step 2:
Row three has three zeroes, so leave it
Row 4 has no assignable zero, so leave it
Row 5 has one assignable zero. Assign it and cross all the other zero in this column
Now, start making assignments in the columns:
Step 1:

Now, we see that all zeroes are either assigned or crossed. Now, we have 4 assignments
against 5
Again follow the procedure of ticking

We see there are no more ticks possible


Now, draw lines through unticked rows and ticked columns

Now, we reconstruct the matrix.


Find out the minimum value through which the line is not passing. We see in the first row,
this number is 1. So, we take Ɵ = 1
Now, subtract Ɵ from all the numbers through which the line is not passing.
Add Ɵ to all the numbers that have two lines passing through them.
And keep the rest of them the same
This is shown below:
Now, start making assignments in the rows:
Step 1:
In the first row, there are two zeroes, so we can’t make an assignment, leave it
In the second row, there is one zero, assign it

In the third row, there are three zeroes, so we can’t make an assignment, leave it
In the 4th row, there is one zero, assign it

In the 5th row:


Now, assign in columns:
Step1: First column

Now, we see that all zeroes are either assigned or crossed. Now, we have 4 assignments
against 5.
This makes us understand that there is no guarantee that with each iteration, we will
have one more assignment
Again follow the procedure of ticking
Now, draw lines through unticked rows and ticked columns

We see that we have covered all the zeroes.


Find out the minimum value through which the line is not passing. We see in the 3rd row,
this number is 1. So, we take Ɵ = 1
Now, subtract Ɵ from all the numbers through which the line is not passing.
Add Ɵ to all the numbers that have two lines passing through them.
And keep the rest of them the same
This is shown below:
Now, start making assignments in the rows:
Step 1:
In the first row, there are three zeroes, so we can’t make an assignment, leave it
In the second row, there is one zero, assign it
In the 3rd row, there are three zeroes, so we can’t make an assignment, leave it
In the 4th row, assign:
In the 5th row:
Now, assign in columns:

In first column:

Now, we see that all zeroes are either assigned or crossed. We still have 4 assignments
against 5.
This makes us understand that there is no guarantee that with each iteration, we will
have one more assignment
Again follow the procedure of ticking
Now, draw lines through unticked rows and ticked columns

Find out the minimum value through which the line is not passing. We see in the first row,
this number is 1. So, we take Ɵ = 1
Now, subtract Ɵ from all the numbers through which the line is not passing.
Add Ɵ to all the numbers that have two lines passing through them.
And keep the rest of them the same
This is shown below:
Now, start making assignments in the rows:
Step 1:
In the first row, there are 4 zeroes, so we can’t make an assignment, leave it
In the second row, there is one zero, assign it
In the 3rd row, there are three zeroes, so we can’t make an assignment, leave it
In the 4th row, assign:
In the 5th row:
Now, assign in columns:
Column 1 has two zeroes, leave it
Columns 2 and 3, assignments have already been made.
Assign in column 4:
Now, come back to the row:
Assign in Row1:

Now, we see that all zeroes are either assigned or crossed. We have 5 assignments
against 5. This is the optimal solution.
The assignments are X11, X23, X34, X42, X55
The assignments are X11, X23, X34, X42, X55.
The value of the objective function is 51
Hungarian Method
Perform Row minimum operation
Perform column minimum operation
Primal assignment problem
Introduce dual variables u and v where u and v are solution to the dual
Dual will be:

This algorithm is called Hungarian algorithm, very popular to solve the assignment problem
Feasible and optimal solution to the problem
Another example:
Perform row minimum subtraction to get Us
column minimum subtraction to get Vs

This is reduced matrix where C’ij = Cij -(ui+vj)


Lets make assignments now first rowwise and then columnwise
Again follow the procedure of ticking
Now, draw lines through unticked rows and ticked columns

Find out the minimum value through which the line is not passing. We see in the fifth row,
this number is 1. So, we take Ɵ = 1
Now, subtract Ɵ from all the numbers through which the line is not passing.
Add Ɵ to all the numbers that have two lines passing through them.
And keep the rest of them the same
This is shown below:
This is what we have done in the previous slide w.r.t. original problem

Now, whether we solve this or whether we solve original problem, optimal solution will be same

Вам также может понравиться