YALMIP modeling speed issues #1443
-
Hi, I have a question I need to ask. When I use yalmip to model the same MILP problem, the modeling speed slows down as the number of times I model increases, and I use the clc, clear commands before modeling, what is the reason for this? Whenever I invoke the gurobi solver, it is always the first modeling that is the fastest! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Typical bad modelling is to repeatedly defining new sdpvars inside a loop, when you just as well can define them outside, and the construct new models inside loop. even further, sometimes there are onoly parts of a model that changes, and then one should simply define those and add inside the loop, and final improvement is to use optimizer if possible. If you still have to redefine from scratch, you are probably missing a yalmip('clear') |
Beta Was this translation helpful? Give feedback.
Typical bad modelling is to repeatedly defining new sdpvars inside a loop, when you just as well can define them outside, and the construct new models inside loop. even further, sometimes there are onoly parts of a model that changes, and then one should simply define those and add inside the loop, and final improvement is to use optimizer if possible.
If you still have to redefine from scratch, you are probably missing a yalmip('clear')