Chapter Contents 
Previous 
Next 
Introduction to Optimization 
The transportation and assignment models are described in rectangular data sets. Suppose that instead of sending chocolate from factories to warehouses and then to the customers, chocolate is sent directly from the factories to the customers.
Finding the minimum cost routing could be done using the NETFLOW procedure. However, since the network represents a transportation problem, the data for the problem can be represented more simply.
data transprt; input source $ supply cust_1 cust_2 cust_3 ; datalines; demand . 100 200 50 factory1 500 10 9 7 factory2 500 9 10 8 ;
This data set shows the source names as the values for the source variable, the supply at each source node as the values for the supply variable, and the unit shipping cost for source to sink as the values for the sink variables cust_1 to cust_3. Notice that the first record contains the demands at each of the sink nodes.
The TRANS procedure finds the minimum cost routing. It solves the problem and saves the solution in an output data set.
proc trans nothrunet data=transprt out=transout; supply supply; id source; proc print;run;
The optimum solution total (3050) is reported on the SAS log. The entire solution (Figure 1.17) shows the amount of chocolate to ship from each factory to each customer, per day.
The resulting data set called out contains the variables listed in the var and id statements, and a new variable called _dual_. This variable _dual_ contains the marginal costs of increasing the supply at each origin point. The last observation in the out data set has the marginal costs of increasing the demand at each destination point. These variables are called dual variables.

Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.