Hi
I have been trying to run a network flow and get integer values for the flows.
Objective is to use generalized network as nodes L1, L2 has to be visited only once. However, I am unable to get integer values for the formulation. For some reason, interior point algorithm is triggered and not network simplex optimizer. I am not sure if I have used the right way to specify the lower and upper bounds. Please let me know if I am missing something.
/*
_from_ = from node, _to_ = to node, _cost_ = cost to objective function, _mult_ = multiplier, _ lo_ = lower_bound , _up_ = upper_bound
*/
proc netflow
arcdata = garcs
nodedata = gnodes
conout = gnetout
source=A1
sink=COLLECT;
capacity _up_;
lo _lo_;
mult _mult_;
cost _cost_;
run;
data gnodes;
infile datalines dlm="|";
input _node_ :$25. _sd_ :8.;
datalines;
A1|1
COLLECT|-3
;
run;
/*
_from_ = from node, _to_ = to node, _cost_ = cost to objective function, _mult_ = multiplier, _ lo_ = lower_bound , _up_ = upper_bound
*/
data garcs;
infile datalines dlm="|";
input _from_ :$25. _to_ :$25. _cost_ :8. _mult_ :8. _lo_ :8. _up_ :8.;
datalines;
A1|L1T0|19|1|0|1
A1|L2T0|1|1|0|1
L1T0|L1T0P|0|2|0|1
L2T0|L2T0P|0|2|0|1
L1T0P|L1SUPER|0|1|0|1
L1T0P|L2T1|7|1|0|1
L2T0P|L2SUPER|0|1|0|1
L2T0P|L1T1|4|1|0|1
L1T1|L1T1P|0|2|0|1
L2T1|L2T1P|0|2|0|1
L1T1P|L1SUPER|0|1|0|1
L2T1P|L2SUPER|0|1|0|1
L1T1P|A1SINK|116|1|0|1
L2T1P|A1SINK|95|1|0|1
L1SUPER|COLLECT|0|1|0|1
L2SUPER|COLLECT|0|1|0|1
A1SINK|COLLECT|0|1|0|1
;
run;
Generalized network flow problems do not have the integrality property, so there might not be an optimal solution that takes only integer values. Also, PROC NETFLOW is a legacy procedure that is no longer documented. The SAS/OR 14.1 documentation provides an example that illustrates how to solve a generalized network flow problem with PROC OPTMODEL:
SAS/OR: PROC OPTNET or the network solver in PROC OPTMODEL
SAS Optimization on SAS Viya: PROC OPTNETWORK or the network solver in PROC OPTMODEL
All those linked docs have lots of examples.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.