Add to Favorites    Make Home Page 4854 Online  
 Language Categories  
 Our Services  

Home » C Home » Mathematics Home » Transportation Cost Problem

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Transportation Cost Problem
Author K.Jayanth
Author Email jayc02msc [at] drmcet.org
Description Operation Research :Transportation Problem
This transportation Problem will give the estimate the cost of the transportation.It consists of the supply and Demand.There are
two conditions
1)if supply greater than demand then element values * demand and supply will be subtracted from demand
2)If suppply less than demand then element values * supply and demand will be subtracted from supply.
Finally cost matrix is printed and the Sum of the allocated Matrix can be also calculated.The final sum is the Transportation Cost

Category C » Mathematics
Hits 383532
Code Select and Copy the Code
Code : /************************************************************************* **/ /* */ /* Title : Transportation Problem in Operation Research */ /* Author : K.JAYANTH IV Msc(Software Engineering) */ /* College : Dr.Mahalingam College Of Engineering and Technology */ /* Mail-ID : jayc02msc@drmcet.org */ /* */ /* *********************************************************************** */ /* Look last of coding for SAMPLE INPUT*/ #include<stdio.h> #include<conio.h> main() { int flag=0,flag1=0; int s[10],d[10],sn,eop=1,dm,a[10][10]; int i,j,sum=0,min,x[10][10],k,fa,fb; clrscr(); /* Getting The Input For the Problem*/ printf("Enter the number of Supply "); scanf("%d",&sn); printf("Enter the number of Demand "); scanf("%d",&dm); printf("Enter the Supply Values "); for(i=0;i<sn;i++) scanf("%d",&s[i]); printf("Enter the Demand Values "); for(j=0;j<sn;j++) scanf("%d",&d[j]); printf("Enter the elements of the array "); for(i=0;i<sn;i++) { for(j=0;j<dm;j++) { scanf("%d",&a[i][j]); } } /* Calculation For the Transportation */ i=0;j=0; for(i=0,j=0;i<sn,j<dm;) { if(s[i]<d[j]) // Check supply less than demand { x[i][j]=a[i][j]*s[i]; // Calculate amount * supply d[j]=d[j]-s[i]; // Calculate demand - supply i++; // Increment i for the deletion of the row or column } else if(s[i]>=d[j]) //Check the supply greater than equal to demand { x[i][j]=a[i][j]*d[j]; // Calculate amount * demand s[i]=s[i]-d[j]; // Calculate supply - demand j++; // Increment j for the deletion of the row or column } } /* The Cost Matrix is Estimated here */ printf("Given Cost Matrix is : "); for(fa=0;fa<sn;fa++) { for(fb=0;fb<dm;fb++) { printf("%d ",a[fa][fb]); } printf(" "); } /* The Allocated Cost Matrix is */ printf("Allocated Cost Matrix is "); for(fa=0;fa<sn;fa++) { for(fb=0;fb<dm;fb++) { printf("%d ",x[fa][fb]); sum=sum+x[fa][fb]; } printf(" "); } /* Transportation Cost Estimated and Sum is Printed*/ printf("The Transportation cost:%d ",sum); getch(); } /* SAMPLE INPUT 11 13 17 14 16 18 14 10 21 24 13 10 11 11 11 11 Given Cost Matrix is : 11 13 17 14 16 18 14 10 21 24 13 10 11 11 11 11 Allocated Cost Matrix is 2200 650 0 0 0 3150 700 0 0 0 2925 500 0 0 0 2200 The Transportation cost:12325 */

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=879


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review