transportation


transportation, a Python code which computes a feasible solution to a simple version of the transportation problem, in which a resource must be transported from several supply centers to several demand centers at minimal cost.

There is a resource currently stored at a number of supply centers, which needs to be transported to a number of demand centers. There is a path or connection from each supply center to each demand center. Each such path has an associated cost charged to transport each unit of resource. The administrator must decide a transportation plan which sends the demanded amount of resource to each demand center, in such a way as to minimize the total cost.

This problem can alternatively be considered an example of a minimal cost matching of nodes in a bipartite graph.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

transportation is available in a MATLAB version and an Octave version and a Python version

Related Data and Programs:

bellman_ford, a Python code which implements the Bellman-Ford algorithm for finding the shortest distance from a given node to all other nodes in a directed graph whose edges have been assigned real-valued lengths.

floyd, a Python code which implements Floyd's algorithm for finding the shortest distance between pairs of nodes on a directed graph.

toms097, a Python code which computes the distance between all pairs of nodes in a directed graph with weighted edges, using Floyd's algorithm.

Reference:

  1. Frank Hitchcock,
    The distribution of a product from several sources to numerous localities,
    MIT Journal of Mathematics and Physics,
    Volume 20, pages 224-230, 1941.

Source Code:


Last revised on 02 April 2026.