The NETFLOW Procedure |
Suppose that the airlines state that the freight cost per pineapple in flights that leave Chicago has been reduced by 30. How many pineapples should take each route between Hawaii and London? This example illustrates how PROC NETFLOW uses a warm start.
In Example 5.2, the RESET statement of PROC NETFLOW is used to specify FUTURE1. A NODEOUT= data set is also specified. The warm start information is saved in the arcout1 and nodeout1 data sets.
In the following DATA step, the costs, reduced costs, and flows in the arcout1 data set are saved in variables called oldcost, oldflow, and oldfc. These variables form an implicit ID list in the following PROC NETFLOW run and will appear in ARCOUT=arcout2. Thus, it is easy to compare the previous optimum and the new optimum.
title 'Minimum Cost Flow Problem - Warm Start'; title2 'How to get Hawaiian Pineapples to a London Restaurant'; data aircost2; set arcout1; oldcost=_cost_; oldflow=_flow_; oldfc=_fcost_; if ffrom='Chicago' then _cost_=_cost_-30; proc netflow warm arcdata=aircost2 nodedata=nodeout1 arcout=arcout2; tail ffrom; head tto; proc print data=arcout2; var ffrom tto _cost_ oldcost _capac_ _lo_ _flow_ oldflow _fcost_ oldfc; sum _fcost_ oldfc; run;The following notes appear on the SAS log:
NOTE: Number of nodes= 8 . NOTE: Number of supply nodes= 1 . NOTE: Number of demand nodes= 1 . NOTE: Total supply= 500 , total demand= 500 . NOTE: Number of iterations performed (neglecting any constraints)= 3 . NOTE: Of these, 1 were degenerate. NOTE: Optimum (neglecting any constraints) found. NOTE: Minimal total cost= 93150 . NOTE: The data set WORK.ARCOUT2 has 13 observations and 16 variables.
ARCOUT=arcout2 is shown in Output 5.3.1.
Output 5.3.1: ARCOUT=ARCOUT2
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.