Transportation problem is one of the sub-classes of Linear Programming Problems. The structure of transportation problem involves a large number of shipping routes from several supply origins to several demand destinations. The objective is to determine the number of units which should be shipped from an origin to a destination in order to satisfy the required quantity of goods or services at each demand destination, within the limited quantity of goods or services available at each supply origin, at the minimum transportation cost.
There are several methods available to obtain an initial basic feasible solution but here, we will be using the Least Cost Method as well as a C# programming language to write the program.
The Least Cost Method
This method finds a better starting solution by concentrating on the cheapest routes. The method starts by assigning as much as possible to the cell with the smallest unit cost. Next, the satisfied row or column is crossed out and the amounts of supply and demand are adjusted accordingly. If both a row and a column are satisfied simultaneously, only one is crossed out. Next, look for the uncrossed-out cell with the smallest unit cost and repeat the process until exactly one row or column is left uncrossed out, then all the remaining variables are basic and are assigned the only feasible allocation.
Solving Transportation Problem Using Least Cost Method and C# Programming Language
There’s been a lot of hype concerning this topic. Even when you search on Google about a source code of any programming language that can perform this task in question, you will never get any valuable answer apart from an online calculator that solves it but without the source code made available.
Here in this guide, am giving you a C# source code to a program that can solve a transportation problem using the Least Cost Method (LCM).
The program can solve a transportation problem of 2×2, 2×3, 3×3, 3×4 etc. It also has an Iteration table where it explains how the iteration and solving were done. Most importantly, the program is very accurate and effective.
How it Works (Output)
Whenever you start the program, the first window that shows up is the splash screen. That is the window that shows up while the program loads all the necessary libraries required for it to work and it also explains a bit what the program is all about including the name of the program and the company that wrote it.
After the splash screen, the next window that shows up is the one that asks for the number of rows and columns that you want the program to solve.
After entering the values, you will need to click on Start button to create the entering variables and table.
The next window is the form that allows you to enter the values of all the sources, destinations, demands and supplies.
After entering the values, you will need to click on Calculate button to begin the solving process.
The next window is the form that displays the result which includes the iteration table and the Total Minimum Cost (Z)
You can see everything is made so simple, easy and clear. That is the power of variables and codes.
As aforementioned, this program solves many dimensions of transportation problems. Another example here is a 3×3 transportation problem.
This is the input:
This is the output
Here is a little source code of this program. The FULL source code will be made available for free to the general public by December 25th, 2017. There is a reason for that. But if you urgently need the source code you can drop a comment below indicating that you need it or send an email to firstname.lastname@example.org you can also call/WhatsApp +2348066017971. It attracts a little amount of money, but I assure you, you will get a good value for your money.
private void buttonCalculate_Click(object sender, EventArgs e)
if (richTextBoxR11.Text == "" || richTextBoxR12.Text == "" || richTextBoxR13.Text == "" || richTextBoxR21.Text == "" || richTextBoxR22.Text == "" || richTextBoxR23.Text == "" || richTextBoxR31.Text == "" || richTextBoxR32.Text == "" || richTextBoxR33.Text == "" || richTextBoxS1.Text == "" || richTextBoxS2.Text == "" || richTextBoxD1.Text == "" || richTextBoxD2.Text == "" || richTextBoxD3.Text == "")
MessageBox.Show("Please, fill all required fields!", "Incomplete data Input!", MessageBoxButtons.OK, MessageBoxIcon.Error);
timer1.Enabled = true;
I hope this guide helps you to keep up with your school assignment or project. If you have any contribution to this program, you can also drop your views here using the comment box. Thanks so much for stopping by.