Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 52

Transportation Problem

Modified Distribution Method


(MODI)

Amit Prakash Jha


The Problem

I II III IV Supply
                       
1   10    2    20    11  15
                       
                       
2   12    7    9    20  25
                       
                   
3   4    14    16  18  10
                       
Demand 5 15 15 15
Initial Basic Feasible Solution
through North-West Corner Method

I II III IV
     5     10          
1   10     2     20     11  
                       
           5     15   5
2   12     7     9     20  
                       
                  10
3   4     14     16   18  
                       

COST: 10x5 + 2x15 + 7x5 + 9X15 + 20x5 + 18x10


= 520
Degeneracy Check
# of rows in the problem matrix (m): 3
# of columns in the problem matrix (n): 4

# of allocations in initial basic feasible solution should be m + n - 1


Otherwise, the problem will be degenerate and this approach will not work

Here, number of allocations: 6 (which is indeed equal to m + n – 1)


Hence, the problem is not degenerate and we may proceed
Basic and non-basic variables
In transportation problem there is a decision variable
corresponding to every cell. For example, are decision variables
corresponding to green cell and the blue cell in the problem
matrix
Basic and non-basic variables
represents the number of units transported from origin 1 to
destination I (green cell)
represents the number of units transported from origin 2 to
destination III (blue cell)
Basic and non-basic variables
A decision variable in initial feasible solution (through a
method such as NWCM or VAM or LCM) is said to be basic if
there is some allocation (i.e. non-zero - it may be
infinitesimal) in the corresponding cell. (otherwise, non-
basic)
Basic and non-basic variables
A decision variable in initial feasible solution (through a method such as
NWCM or VAM or LCM) is said to be basic if there is some allocation (i.e. non-
zero - it may be infinitesimal) in the corresponding cell. (otherwise, non-
basic)
Form (u,v) equations for each basic variable
Form (u,v) equations for each basic variable
Solve (u,v) equations

In general, you will have less equations than variables


Solve (u,v) equations

Hence, assume one variable to be zero and proceed


Solve (u,v) equations
Evaluate Δ for non-basic variables
Evaluate Δ for non-basic variables

Since, it is minimization problem, all Δ should be negative for


optimality. The variable corresponding to largest positive Δ will
enter the basis
Evaluate Δ for non-basic variables

Since, it is minimization problem, all Δ should be negative for optimality.


The variable corresponding to largest positive Δ will enter the basis
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
    5    10           
1  10    2    20    11  15
                       
          5    15    5
2  12    7    9    20  25
                       
 Θ                 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
    5    10           
1  10    2    20    11  15
                       
          5    15    5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
    5    10           
1  10    2    20    11  15
                       
          5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
  5    10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
    5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ for entering variable and form a loop
through allocated cells
I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
Now the question is...
What maximum Θ can we allocate?
I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
What maximum Θ can we allocate?
Demand supply constraints must be satisfied, and
Allocations must be non negative

I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
What maximum Θ can we allocate?
Demand supply constraints must be satisfied, and
Allocations must be non negative. Hence, Θ should be 5

I II III IV Supply
 5-Θ   5 10+Θ   10           
1  10    2    20    11  15
                       
       5-Θ   5    15 5+Θ   5
2  12    7    9    20  25
                       
 Θ                 10-Θ 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
What maximum Θ can we allocate?
Demand supply constraints must be satisfied, and
Allocations must be non negative. Hence, Θ should be 5

I II III IV Supply
 5-5   5 10+5   10           
1  10    2    20    11  15
                       
       5-5   5    15 5+5   5
2  12    7    9    20  25
                       
 5                 10-5 10
3  4    14    16  18  10
                       

Demand 5 15 15 15
What maximum Θ can we allocate?
Demand supply constraints must be satisfied, and
Allocations must be non negative. Hence, Θ should be 5

I II III IV Supply
 5-5    10+5              
1  10    2    20    11  15
                       
       5-5       15  5+5  
2  12    7    9    20  25
                       
 5                 10-5
3  4    14    16  18  10
                       

Demand 5 15 15 15
What maximum Θ can we allocate?
Demand supply constraints must be satisfied, and
Allocations must be non negative. Hence, Θ should be 5

I II III IV Supply
 0    15              
1  10    2    20    11  15
                       
       0       15  10  
2  12    7    9    20  25
                       
 5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Arbitrarily drop one of the zero allocations

I II III IV Supply
     15              
1  10    2    20    11  15
                       
       0    15    10  
2  12    7    9    20  25
                       
 5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Arbitrarily drop one of the zero allocations

I II III IV Supply
     15              
1  10    2    20    11  15
                       
       0    15    10  
2  12    7    9    20  25
                       
 5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15

COST 5x4 + 15x2 + 0x7 + 15x9 + 10x20 + 5x18 = 475


Solution to (u,v) equation (degeneracy check is favourable)

v1 = 1 v2 = 2 v3 = 4 v4 = 15
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
                       
       0    15    10  
u2=5 2  12    7    9    20  25
                       
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Δ

v1 = 1 v2 = 2 v3 = 4 v4 = 15
I II III IV Supply
u1=0  0    15              
1  10    2    20    11  15
             -16      4    
           15    10  
u2=5 2  12    7    9    20  25
 -6      0                
u3= 3  5                 5
3  4    14    16  18  10
       -9      -9          

Demand 5 15 15 15
Maximum positive Δ

v1 = 1 v2 = 2 v3 = 4 v4 = 15
I II III IV Supply
u1=0  0    15              
1  10    2    20    11  15
             -16      4    
           15    10  
u2=5 2  12    7    9    20  25
 -6      0                
u3= 3  5                 5
3  4    14    16  18  10
       -9      -9          

Demand 5 15 15 15
Maximum positive Δ

v1 = 1 v2 = 2 v3 = 4 v4 = 15
I II III IV Supply
u1=0  0    15              
1  10    2    20    11  15
             -16      4    
           15    10  
u2=5 2  12    7    9    20  25
 -6      0                
u3= 3  5                 5
3  4    14    16  18  10
       -9      -9          

Demand 5 15 15 15
Put Θ

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-Θ            Θ    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+Θ            10-Θ    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Put Θ

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-Θ            Θ    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+Θ            10-Θ    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
The Loop

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-Θ            Θ    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+Θ            10-Θ    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Maximum Θ?

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-Θ            Θ    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+Θ            10-Θ    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Maximum Θ = 10

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-Θ            Θ    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+Θ            10-Θ    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Maximum Θ = 10

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       15-10            10    
       0    15    10  
u2=5 2  12    7    9    20  25
       0+10            10-10    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Maximum Θ = 10

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0      15              
1  10    2    20    11  15
       5            10    
       0    15    10  
u2=5 2  12    7    9    20  25
       10            0    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Updated Allocation

v1 = 10 v2 = 2 v3 = 13 v4 = 24
I II III IV Supply
u1=0                    
1  10    2    20    11  15
       5            10    
           15      
u2=5 2  12    7    9    20  25
       10            0    
u3= 3  5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Updated Allocation

I II III IV Supply
     5          10    
1  10    2    20    11  15
                       
       10    15      
2  12    7    9    20  25
                       
 5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15
Cost (This is improvement!)

I II III IV Supply
     5          10    
1  10    2    20    11  15
                       
       10    15      
2  12    7    9    20  25
                       
 5                 5
3  4    14    16  18  10
                       

Demand 5 15 15 15

COST 5x4 + 5x2 + 10x7 + 15x9 + 10x11 + 5x18 =435


Allocation is non-degenerate, hence, OK
(u,v) equation and Δ

v1=-3 v2=2 v3=4 v4=11


I II III IV Supply
u1=0      5          10    
1  10    2    20    11  15
 -13            -16          
       10    15      
u2=5 2  12    7    9    20  25
 -10                  -4    
 5                 5
u3=7 3  4    14    16  18  10
       -5      -5          

Demand 5 15 15 15
All Δ are negative and therefore this is optimal solution (transportation
cost is minimum) and minimum cost is 435
Transportation Problem
Solution Using R (The Problem)
Transportation Problem
Solution Using R (The set-up)

In general, supply constraints will be of the form “<=“ and demand


constraint will be of the form “>=“ but in balanced problems “=“ work
equally well...
Transportation Problem
Solution Using R (The main function)

You have to have the library lpSolve pre installed and loaded
Transportation Problem
Solution Using R (The solution)
R will give one solution even if there are multiple optima...
This should not be a matter of concern 
THANK YOU

You might also like