You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/331960696

4. Transportation Problem and Its Object Oriented Programming Languages

Article · September 2015

CITATIONS READS

2 3,295

1 author:

Malathi Latha
Sri Chandrasekharendra Saraswathi Viswa Mahavidyalaya University
21 PUBLICATIONS   4 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Malathi Latha on 22 March 2019.

The user has requested enhancement of the downloaded file.


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

Transportation Problem and Its


Object Oriented Programming Languages
R.Malathi
Assistant Professor, Dept of Mathematics,SCSVMV University, Enathur, Kanchipuram-631 561,
malathihema@yahoo.co.in

Abstract: Transportation problem is a special class of Linear


Programming Problem which deals with the distribution of
single commodity from various Sources of supply to various
destination of demand in such manner that the total
1.3
transportation cost is minimized. Usually for the initial allocation
in the case of transportation problem methods such as North-
West Corner Method (NWCM), Least Cost Method (LCM),
Vogel's Approximation Method (VAM), NMD Method and Zero
suffix Method are used. Finally the purpose for optimality MODI
check is carried out.

Key words: Feasible solution , constraints, C programs , demand,


capacity and supply. II. TRANSPORTATION PROBLEM

I. MATHEMATICAL REPRESENTATION The transportation problem is one of the sub-


class of Linear Programming Problems. The
Let there be 𝑚 sources of supply, S1, S2,
structure of transportation problem involves a large
S3,…,Sm. having 𝑎𝑖 (𝑖 = 1,2,, 𝑚) units of supply number of shipping routes from several supply
(or capacity) respectively, to be transported among origins to several demand destinations. The
𝑛 destinations, 𝐷1,𝐷2,𝐷3,𝐷4, ...,𝐷n. with 𝑏𝑗 (𝑗 = 1,2, objective is to determine the number of units which
, 𝑛) units of demand (or requirement) should be shipped from an origin to a destination in
respectively. Let 𝐶𝑖𝑗 be the cost of shipped one unit order to satisfy the required quantity of goods or
of commodity from source 𝑖 to destination 𝑗 for services at each demand destination, within the
each route. If 𝑥𝑖𝑗 represents number of units limited quantity of goods of services available at
each supply origin, at the minimum transportation
shipped per route from source 𝑖 to destination 𝑗, cost. There are several methods available to obtain
then the problem is to determine the transportation an initial basic feasible solution. Here we shall
schedule so as to minimize the transportation cost discuss only four methods to determine the solution
satisfying supply and demand. Mathematically, the for balanced transportation problem:
problem in general may be stated as follows: 1. Vogel’s Approximation Method
=
(1. 2. Column Minimum Method
1 The four methods differ in the "quality" of the
starting basic solution they produce and better
Subject to the constraints starting solution yields a smaller objective value.

1.2 III. VOGEL’s APPROXIMATION METHOD


(VAM)

Vogel’s Approximation Method is an


improved version of the Least-cost method that

R.Malathi ijesird, Vol. II (III) September 2015/138


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

generally produces better starting solutions. Continue the process for the resulting
(i) For each row (column) determine a penalty reduced transportation table until all the rim
measure by subtracting the smallest unit cost conditions are satisfied. [14]
element in the row (column) from the next smallest
unit cost element in the same row (column). V. OBJECT ORIENTED PROGRAMMING
(ii) Identify the row or column with the largest
penalty. Break ties arbitrarily. Allocate as much as Object oriented programming is
possible to the variable with the least unit cost in method of implementation in which programs are
the selected row or column. Adjust the supply and organized as cooperative collections of objects and
demand and cross out the satisfied row or column. each object is an instance of some classes, classes
If a row and column are satisfied simultaneously, are related to one another via inheritance
only one of the two is crossed out, and the relationship. [8]. In Object oriented programming,
remaining row (column) is assigned zero supply the data and functions are integrated. An object is
(demand). like a box containing it data and its functions which
(iii) (a) If exactly one row or column with zero can operate on the data.[9]. Objects are the basic
supply or demand remains uncrossed out, stop. elements for executing object oriented programs
(b) If one row (column) with positive supply while classes are the basic elements for defining
(demand) remains uncrossed out, determine the object oriented programs. If any of these elements
basic variables in the row (column) by the is missing, it is not an object oriented program.[9].
least-cost method .stop. Object oriented programming languages such as
(c) If all the uncrossed out rows and columns java, C# and C++.
have (remaining) zero supply and demand,
determine the zero basic variables by the least- A. SOLVING TRANSPORTATION
cost method .stop. PROBLEM USING C LANGUAGE:
(d) Otherwise, go to step (i). [6] We need to describe the four methods
(mentioned above) of transportation model in
IV. COLUMN MINIMUM METHOD (CMM) Linear Programming using the four algorithms.
After designing for the four methods we develop C
Column minimum method starts with first program for each one. We used C language to
column and chooses the lowest cost cell of first facilitate getting the result and complex problems
column so that either the demand of the first which take long time using Linear Programming
distribution center is satisfied or the capacity of the solution. After running these programs we
ith supply is exhausted or both. Three cases arise: compared between each solution using C program
(i) If the demand of the first distribution center is and Linear Programming solution which show that
satisfied, cross of the first column and move right to have the same result. The main ideas from design
the second column. four C programs are save time, money, and effort.
(ii) If the capacity of ith supply is satisfied, cross off
ith row and reconsider the first column with the a. Vogel’s approximation method
remaining demand. #include<stdio.h>
(iii) If the demands of the first distribution center as #include<conio.h>
well as the capacity of the ith supply are completely void sort(int a[],int n)
satisfied, make a zero allocation in the second { inttemp,j,k;
lowest cost cell of the first column. Cross of the for(j=0;j<n;j++)
column as well as the ith row and move right to the { for(k=j+1;k<n;k++)
second column. { if(a[j]>a[k])

R.Malathi ijesird, Vol. II (III) September 2015/139


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

{ temp=a[j]; for(i=0;i<m;i++)
a[j]=a[k]; { k=0;
a[k]=temp; if(rf[i]!=1)
} { for(j=0;j<n;j++)
} { if(cf[j]!=1)
} a[k++]=c[i][j];
} }
void main() if(k==1)
{ rp[i]=a[0];
inti,j,b,p,d,k,m,n,c[20][20],cf[20],rf[20],a[20],cp[20 else
],rp[20]; { sort(a,k);
int sup[20],dem[20],max,min,s,t,sum=0; rp[i]=a[1]-a[0];
clrscr(); }
printf("\nEnter the row & column:"); }
scanf("%d%d",&m,&n); }
printf("\nEnter the cost:"); for(i=0;i<n;i++)
for(i=0;i<m;i++) { k=0;
{ for(j=0;j<n;j++) if(cf[i]!=1)
scanf("%d",&c[i][j]); { for(j=0;j<m;j++)
} { if(rf[j]!=1)
printf("\nEnter the demand:"); a[k++]=c[j][i];
for(i=0;i<n;i++) }
scanf("%d",&dem[i]); if(k==1)
printf("\nEnter the supply:"); cp[i]=a[0];
for(i=0;i<m;i++) else
scanf("%d",&sup[i]); { sort(a,k);
printf("\nMatrix:\n"); cp[i]=a[1]-a[0];
for(i=0;i<m;i++) }
{ for(j=0;j<n;j++) }
printf(" %d ",c[i][j]); }
printf("%d",sup[i]); for(i=0;i<m;i++)
printf("\n"); a[i]=rp[i];
} for(j=0;j<n;j++)
for(j=0;j<n;j++) a[i+j]=cp[j];
printf("%d ",dem[j]); max=a[0];
for(i=0;i<m;i++) p=0;
rf[i]=0; for(i=1;i<m+n;i++)
for(i=0;i<n;i++) { if(max<a[i])
cf[i]=0; { max=a[i];
b=m,d=n; p=i;
while(b>0&&d>0) }
{ for(i=0;i<m;i++) }
rp[i]=-1; printf("\n\n %d %d",max,p);
for(i=0;i<n;i++) min=1000;
cp[i]=-1; if(p>m-1)

R.Malathi ijesird, Vol. II (III) September 2015/140


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

{ p=p-m; b--;
if(cf[p]!=1) d--;
{ for(i=0;i<m;i++) }
{ if(rf[i]!=1) }
{ if(min>c[i][p]) printf("\n\n %d ",sum);
{ min=c[i][p]; getch();
s=i; }
t=p;
} b. Column Minimum Method
} #include<stdio.h>
} #include<conio.h>
} #include<stdlib.h>
} void main()
else {
{ if(rf[p]!=1) intc[10]
{ for(i=0;i<n;i++) [10],a[10],b[10],i,k,j,m,n,p,q,sum1=0,sum2=0,f=0,s
{ if(cf[i]!=1) =0,max=0,min=0;
{ if(min>c[p][i]) clrscr();
{ min=c[p][i]; printf("Enter the no. of rows & column:");
s=p; scanf("%d%d",&m,&n);
t=i; printf("element of cost matrix:\n");
} for(i=0;i<m;i++)
} {
} for(j=0;j<n;j++)
} scanf("%d",&c[i][j]);
} printf("\n");
printf("\n\n %d %d %d",min,s,t); }
if(sup[s]<dem[t]) printf("Elements of supply matrix:\n");
{ sum+=c[s][t]*sup[s]; for(i=0;i<m;i++)
dem[t]-=sup[s]; {
rf[s]=1; scanf("%d",&a[i]);
b--; sum1=sum1+a[i];
} }
else printf("Elements of demand matrix:\n");
if(sup[s]>dem[t]) for(j=0;j<n;j++)
{ sum+=c[s][t]*dem[t]; {
sup[s]-=dem[t]; scanf("%d",&b[j]);
cf[t]=1; sum2=sum2+b[j];
d--; }
} if(sum1==sum2)
else printf("\nThe problem is balanced.\n");
if(sup[s]==dem[t]) else
{ sum+=c[s][t]*dem[t]; printf("\nThe problem is not balanced.");
cf[t]=1;
rf[s]=1; max=c[0][0];

R.Malathi ijesird, Vol. II (III) September 2015/141


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

for(i=0;i<m;i++) b[p]=0;
{ f++;
for(j=0;j<n;j++) }
{ if(a[q]==0)
if(c[i][j]>max) {
max=c[i][j]; for(j=0;j<n;j++)
} c[q][j]=max+1;
} }
for(j=0;j<n;j++) if(b[p]==0)
{ {
do for(i=0;i<m;i++)
{ c[i][p]=max+1;
k=j; }
min=c[0][j]; j=k;
p=j; }while(min<=max);
q=0; }
for(i=0;i<m;i++) printf("The total cost is Rs.=%d/-\n",s);
{ if(f<(m+n-1))
if(c[i][j]<min) printf("\nthe problem is degenarete.");
else
{ printf("\nthe problem is non degenerate");
min=c[i][j]; getch();
q=i; }
p=j;
} VI. CONCLUTION
}
if(min>max) Running the four C programs for solving
break; transportation problem shows that the results of the
if(a[q]>b[p]) four C programs are equal to the result of the Linear
{ Programming solution. But the result the four
s+=min*b[p]; programs are different. The decision maker may
a[q]=a[q]-b[p]; choose the optimal result of the running of the four
b[p]=0; programs (minimum) and determined the number of
f++; units transported from source i to destination j.
}else if(b[p]>a[q])
REFERENCES
{
s+=min*a[q]; [1] Prem Kumar Gupta and D.S.Hira, “Operations Research”,
b[p]=b[p]-a[q]; S.Chand & Company Ltd, New Delhi, 1979.
[2] J K Sharma, “Operations Research-Theory and
a[q]=0; Applications”, Macmillan India Ltd, New Delhi, 2003.
f++; [3] Dr.A.K.Bhunia and Shri L Sahoo, “Advanced Operations
} Research”, Asian Books Private Ltd, New Delhi, 2011.
[4] KantiSwarup, P.K. Gupta and Man Mohan, “Introdution to
else Operations Research”, Sultan Chand & Sons, New
{ Delhi, 1997.
s+=min*a[q]; [5] P.K. Gupta and Man Mohan, “Problems in Operations
Research(Methods & Solutions)”, Sultan Chand &
a[q]=0; Sons, New Delhi, 2006.

R.Malathi ijesird, Vol. II (III) September 2015/142


International Journal of Engineering Science Invention Research & Development; Vol. II Issue III September 2015
www.ijesird.com e-ISSN: 2349-6185

[6] Handy A. Taha, ”Operations Research: An Introduction”, [13] Hitchcock F L (1941). The distribution of a product from
Pearson Education, USA, 2007. several sources to Numerous localities, Journal Of
[7] Dr.H.S.Kasana, and Dr.K.D.Kumar, “Introductory Mathematical Physics, V 20, 1941 PP 224-230.
Operations Research (Theory and Application)”, P No: [14] Reghu Ramakrishnan, Johannes Gehrke“ Database
205-208. management systems”, second Edition McGraw-Hill,
[8] Grady Booch, “Object Oriented Analysis and Design”, August 1999.
Addison-Wisley Professional. 2 editions, USA,1993. [15] Gaurav Sharma , S. H. Abbas ,Vijay kumar Gupta , Solving
[9] Peretz Shovel, “Functional and Object Oriented Analysis Transportation Problem with the help of Integer
and Design” (an integrated methodology). Idea Group Programming Problem , IOSR Journal of Engineering
Publishing (an imprint of Idea Group Inc.). United States of June. 2012, Vol. 2(6) pp: 1274-1277.
America, 2006. [16] Hamdy, T. Operations Research- An Introduction (Sixth
[10] Taghrid, I., Mohamed G., Iman S., 2009. Solving Edition). Pearson Education Inc, 2002.
Transportation Problem Using Object Oriented [17] Taha. H.A., Operations Research- Introduction, Prentice
Model.IJCSNS International Journal of Computer Science Hall of India (PVT), New Delhi, 2004.
and Network Security, VOL.9 No.2. [18] R. Gupta , Time-Cost Transportation Problem, Econ-math
[11] Shore HH ( 1970). The Transportation Problem and the overview, 4(1977), 431-443.
Vogel Approximation Method, Decision Sciences 1(3- [19] G.B Dantzig, Linear Programming and Extensions,
4) 441-457. Princeton University Press, Princeton, N J, 1963.
[12] Reinfeld N V ,Vogel WR (1958 )., Mathematical [20] Koopams T.C., Optimum Utilization of Transportation
Programming New Jersey Prentice- Hall, Englewood System, Econometrica, Supplement vol. 17, 1949.
Cliffs. [21] Charnes, Cooper (1954).The Stepping-Stone method for
explaining linear programmingCalculation in
transportation problems. Management Science 1(1)49-69
.

R.Malathi ijesird, Vol. II (III) September 2015/143

View publication stats

You might also like