This Python script provides a solution to the Transportation Problem using various approximation methods such as North-West corner method, Vogel’s approximation method, Russell’s approximation method. The Transportation Problem involves optimizing the distribution of goods from multiple suppliers to multiple consumers with given supply, demand, and transportation costs.
- Prerequisites: Ensure you have Python 3.8+ installed on your system.
- Clone Repository: Clone the repository and navigate to the directory containing the script.
- Input File: Create a text file, e.g.,
test.txt
, with the specified format (see below). - Run Script
The input file should follow this format:
<supply array>
<demand array>
<cost matrix row 1>
<cost matrix row 2>
...
<cost matrix row n>
Replace <supply array>
, <demand array>
, and <cost matrix row i>
with appropriate values.
160 140 170
120 50 190 110
7 8 1 2
4 5 9 8
9 2 3 6