Hello,
I hope you are doing well.
I am working on a Mixed-Integer Programming (MIP) model. To evaluate the computational complexity of the model, I perform multiple runs using a loop, where each iteration generates a new set of random parameters:
loop(run,
*----- Generate data -----
d(p,i,t) = UniformInt(650,750);
loop(p,
cc = **UniformInt**(1, **card**(u));
l(p) = **sum**(uu$(**ord**(uu)=cc), val(uu));
);
hm(p,s,t)$(**ord**(s)<=**ord**(t)) = 0.01 + (**ord**(t)-**ord**(s))\*l(p);
h(p,s,i,t)$(**ord**(s)<=**ord**(t)) = 0.02 + (**ord**(t)-**ord**(s))\*l(p);
sc(p,t) = 25\***UniformInt**(6,10);
st(p) = **UniformInt**(6,10);
cb(p)=**UniformInt**(2,5);
C(p) = **UniformInt**(150,200);
Vbox(p) = **UniformInt**(250,300);
Vvehicle = **ceil**(1.5\***sum**((p,i,t),(d(p,i,t)/C(p))\*Vbox(p))/**card**(k));
cap(t) = (**sum**((p,i),(d(p,i,t)\*pt(p))) + **sum**(p,st(p)))/0.6;
Cmax = **ceil**(**sum**((p,i,t), d(p,i,t)) / **card**(t));
RCmax(i) = **ceil**(**sum**((p,t), d(p,i,t)) / **card**(t));
*----- Solve -----*
solve PBPP using mip minimizing OF;
display d,l,hm,h,sc,pc,tc,C, Vbox,Vvehicle, cap,Cmax,RCmax,cap;
*----- Store results -----*
Obj(run) = OF.l;
Time(run) = PBPP.resusd;
)
the solve time is quite high. The solver profile shows that a significant portion of the computational time is spent in the loop structure itself: :
— Profile Summary (97 records processed)
33.985 0.004GB 154 Loop
30.046 0.004GB 177 Solver PBPP
9.219 0.004GB 190 Execute
3.903 0.004GB 177 Solver PBPP
0.016 0.004GB 177 Solve Read PBPP
0.016 0.004GB 177 Solve Fini PBPP (849)
Could you please advise on how to reduce the loop execution time of this model? Note that I am working with small instances.
Thank you in advance