# naginterfaces.library.mip.transportation¶

naginterfaces.library.mip.transportation(kost, k15, maxit)[source]

transportation solves the classical Transportation (‘Hitchcock’) problem.

For full information please refer to the NAG Library document for h03ab

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/h/h03abf.html

Parameters
kostint, array-like, shape

The coefficients , for , for .

k15int, array-like, shape

must be set to the availabilities , for ; and must be set to the requirements , for .

maxitint

The maximum number of iterations allowed.

Returns
k15int, ndarray, shape

The contents of are undefined.

numitint

The number of iterations performed.

k6int, ndarray, shape

, for , contains the source indices of the optimal solution (see ).

k8int, ndarray, shape

, for , contains the destination indices of the optimal solution (see ).

k11int, ndarray, shape

, for , contains the optimal quantities which, sent from source to destination , minimize .

k12int, ndarray, shape

, for , contains the unit cost associated with the route from source to destination .

zfloat

The value of the minimized total cost.

Raises
NagValueError
(errno )

On entry, the sum of the availabilities does not equal the sum of the requirements.

(errno )

During computations has been exceeded.

(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

transportation solves the Transportation problem by minimizing

subject to the constraints

where the can be interpreted as quantities of goods sent from source to destination , for , for , at a cost of per unit, and it is assumed that and .

transportation uses the ‘stepping stone’ method, modified to accept degenerate cases.

References

Hadley, G, 1962, Linear Programming, Addison–Wesley