[Source Code] A Program That Solves a Transportation Problem Using Least Cost Method – By FraNK UMEADI

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 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 been 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 was 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 work and it also explain a bit what the program is all about including the name of the program and the company that wrote it.

Transportation Problem Solver Using Least Cost Method


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.

Transportation Problem Solver Using Least Cost Method

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.

Transportation Problem Solver Using Least Cost Method

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)

Transportation Problem Solver Using Least Cost Method

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:

Transportation Problem Solver Using Least Cost Method

This is the output

Transportation Problem Solver Using Least Cost Method



Source Code

Here is a little source code of this program. The FULL source code will be made available for free to the general public by April 25th, 2016. 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 a mail to franksomitex@gmail.com or info@frankapptech.com or 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.

Love it? Share the joy!

We love comments, please share your replies!

Please notice that your comments will be manually approved before being displayed. But don't worry, this is done as quick as possible (less than 10 mins). Thanks!


FraNK UMEADI, FraNKAPP as he is fondly called, is the CEO, FraNKAPPWeb Technologies, an IT company aimed at delivering excellent services such as Bulk SMS, Web Application Development, Software Development, Mobile Application Development, Digital Marketing, and IT Training etc. He is a Professional Blogger (Founder / Owner of FraNKAPPTech.com), System Analyst and Programmer that writes in PHP, Java, and C#. Phone: +2348066017971 , or +2349023819269. E-mail: franksomitex@gmail.com , frank.umeadi@frankappweb.com

You may also like...

10 Responses

  1. Kamillo says:

    Where is free source code?

  2. Mr FraNKAPP, please my group has already started making an attempt to developing this but we could only do the one of 2×2. Other ones like 2×3, 3×3 and 3×4 has been a tough task and from your screenshots here, it shows that you have those ones done. Please i need your help. Though we are using VB.Net

  3. Emeka Okafor says:

    Wow. May God bless you boss FraNKAPP. Our lecturer gave us a group assignment on this topic in Operations Research here in Unizik. We have been looking for a way to battle it. Please me and my group need it. I will give you a call ASAP

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge