# Fast algorithm for Transportation Problem in Python?

The Transportation Problem can be solved with a simplex algorithm, but it's time-consuming.

I'm wondering if there exists a specific Python-implemented algorithm with low complexity.

• I’m having the same question now.... which algorithms did you end up using?
– ElLl
Jan 15 at 14:56
• There are several efficient algorithms to solve besides simplex. Could you provide more details about the kind of constraints you have and the size of your problem? Sep 2 at 19:39

You could try to solve it as a min cost flow problem.

NetworkX is a package for graph algorithms and has algorithms for this implemented. It can easily be installed via pip install networkx.

An minimal working example is given at the bottom of this link:

https://networkx.github.io/documentation/networkx-2.4/reference/algorithms/generated/networkx.algorithms.flow.min_cost_flow.html#networkx.algorithms.flow.min_cost_flow

You can try CBC which uses Dual Simplex (the same algorithm CPLEX & GUROBI use). The easiest way to use that through Python is Pyomo.