Transportation Problem and Its Object Oriented Programming Languages
Transportation Problem and Its Object Oriented Programming Languages
net/publication/331960696
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.
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])
{ 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)
{ 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];
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.
[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
.