Benchmarks Library Multicommodity flow problem
|
|
|
|
$setglobal L 3 * These options limit the amount of information printed to the .lst file option limrow = 0; option limcol = 0; option solprint = off; option Profile=0; *====================================================== * Change this to load an actual data file: $include "instance.gms" *====================================================== alias (i,j,u,k,v); set level /1*%L%/; scalar LL /%L%/; alias (level,level1,level2); scalar tr_sum the total demand; tr_sum=0; loop((k,v)$(not sameas(k,v) and tr(k,v)>0), tr_sum=tr_sum+tr(k,v); ); tr_sum = tr_sum*1024*1024; display tr_sum; set feasX(i,j,k,v) feasible combinations of indices; feasX(i,j,k,v)$(d(i,j)>0 and tr(k,v)>0 and not sameas(k,v) and not sameas(i,j) and not sameas(j,k) and not sameas(i,v)) = yes; scalar total_traffic; total_traffic=sum((k,v)$(not sameas(k,v)), tr(k,v)); display total_traffic; scalar n_arcs; n_arcs=0; loop((i,j)$(d(i,j)>0), n_arcs=n_arcs+1); display n_arcs; file path_stats /_path_stats.txt/; scalar solving_time; file stats /leveled_lp_stats.txt/; positive variables x(i,j, k,v,level); variable f; equations cObj cBandwidth cTrafficDemand cTrafficBalance cTrafficBalance1 ; cObj.. f =e= sum((k,v)$(not sameas(k,v) and tr(k,v)>0), sum((feasX(k,j,k,v),level)$(ord(level)=1), x(k,j,k,v,level)) ); cTrafficDemand(k,v)$(not sameas(k,v) and tr(k,v)>0).. sum((feasX(k,j,k,v),level)$(ord(level)=1), x(k,j,k,v,level)) =l= tr(k,v); cBandwidth(i,j)$(not sameas(i,j) and d(i,j)>0).. sum((feasX(i,j,k,v),level)$(ord(level) sum(i$(feasX(i,u,k,v) or sameas(i,u)), x(i,u,k,v,level)) =e= 0; model routing / cObj cBandwidth cTrafficDemand cTrafficBalance cTrafficBalance1 /; option iterlim=1.e9; option iterlim=1.e9; option limrow = 0; option limcol = 0; routing.reslim = 10000; solve routing using LP maximizing f; |