h03abc 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
and
, at a cost of
per unit, and it is assumed that
and
.
-
1:
– const double
Input
-
On entry: contains the coefficients , for and .
-
2:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
cost.
Constraint:
.
-
3:
– const double
Input
-
On entry: must be set to the availabilities , for ;
-
4:
– Integer
Input
-
On entry: the number of sources, .
Constraint:
.
-
5:
– const double
Input
-
On entry: must be set to the requirements , for .
-
6:
– Integer
Input
-
On entry: the number of destinations, .
Constraint:
.
-
7:
– Integer
Input
-
On entry: the maximum number of iterations allowed.
Constraint:
.
-
8:
– Integer *
Output
-
On exit: the number of iterations performed.
-
9:
– double
Output
-
On exit: , for , contains the optimal quantities which, when sent from source to destination , minimize .
-
10:
– Integer
Output
-
On exit:
, for
, contains the source indices of the optimal solution (see
optq above).
-
11:
– Integer
Output
-
On exit:
, for
, contains the destination indices of the optimal solution (see
optq above).
-
12:
– double *
Output
-
On exit: the value of the minimized total cost.
-
13:
– double
Output
-
On exit: , for , contains the unit cost associated with the route from source to destination .
-
14:
– NagError *
Input/Output
-
The
NAG error argument (see
Section 7 in the Introduction to the
NAG Library CL Interface).
The computations are stable.
Background information to multithreading can be found in the
Multithreading documentation.
An a priori estimate of the run time for a particular problem is difficult to obtain.
A company has three warehouses and three stores. The warehouses have a surplus of 12 units of a given commodity divided between them as follows:
Warehouse |
Surplus |
1 |
1 |
2 |
5 |
3 |
6 |
The stores altogether need 12 units of commodity, with the following requirements:
Store |
Requirement |
1 |
4 |
2 |
4 |
3 |
4 |
Costs of shipping one unit of the commodity from warehouse
to store
are displayed in the following matrix:
|
Store |
|
|
|
Warehouse |
|
|
|
|
|
|
|
|
|
|
|
|
It is required to find the units of commodity to be moved from the warehouses to the stores, such that the transportation costs are minimized. The maximum number of iterations allowed is 200.
None.